bar camp ubiquity presentation
TRANSCRIPT
![Page 1: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/1.jpg)
Hacking Ubiquity
Presented by Andy Edmondshttp://surfmind.com
![Page 2: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/2.jpg)
What is Ubiquity
• Extensible Firefox command line
• Official Mozillalabs project
• Version 0.1.2 (rc5)• 2 months old
![Page 3: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/3.jpg)
Built In Commands
• Search: google, amazon, youtube, yahoo, etc• Tag: add to bookmarks with annotation• Edit: persist changes to page• Acting on selection– Highlight, map, wordcount
• Translate• Zoom
![Page 4: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/4.jpg)
Linguistics in Ubiquity
• Verb• Noun• Modifiers
• This– Always refers to current
selection
• Coming Soon– Me– Here
![Page 5: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/5.jpg)
More on Nouns
• Core Nouns– Contacts– Date– Percentage– Address– Language– Tag– …
• Proposed– Timezone– City– Time
See https://wiki.mozilla.org/Labs/Ubiquity/Nouns
![Page 6: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/6.jpg)
Installing Other Commands
• Command directory: the Herd– Notions of a community of trust– Right now, subscribing previews the code• Auto-update opens major security holes
• Distribution Channel for Your Hacks
![Page 7: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/7.jpg)
Example: Andyed’s Nofollow• CmdUtils.CreateCommand({• name: "nofollow",• • author: {name: "Andy Edmonds", homepage: "http://surfmind.com/lab/mozilla/ubiquity/nofollow.js"},• license: "MPL”,• // helper function • _lookAtLinks: function(bMarkup){
– var doc = CmdUtils.getDocumentInsecure();– for(var i=0;i<doc.links.length;i++) {– …– }– str+= "Of " + i + " links, ";– str+= linkOffsiteCount + " go offsite (of " + curDomain + "), and ” + linkUniqueCount + " are unique.<br/><br/>”;– str+="found <strong>" + found + "</strong> no-followed.<br/><br/>"– return str;
• },• preview: function( pblock ) {• pblock.innerHTML = this._lookAtLinks(false);• },• execute: function() {• this._lookAtLinks(true);• }• })
Install at http://surfmind.com/lab/mozilla/ubiquity/nofollow.html
![Page 8: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/8.jpg)
Resources to Get Started
• Command-editor (real time testing)– chrome://ubiquity/content/editor.html
• Authoring Tutorial– https://wiki.mozilla.org/Labs/Ubiquity/
Ubiquity_0.1_Author_Tutorial
• The Herd– https://labs.toolness.com/ubiquity-herd/
![Page 9: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/9.jpg)
Ubiquity Command Support
• CmdUtils– chrome://ubiquity/content/cmdUtils.js– Library for accessing selections, the doc &
window, clipboard, screenshot, & templating engine
• Jquery• FUEL: Extension developer library
![Page 10: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/10.jpg)
FUEL Library
• Preferences• Session Storage• Filesystem• Etc.
Intended to reduce pain (and increase API stability) of Firefox XPCOM
![Page 11: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/11.jpg)
Enterprise Command Line: VersionOne.com
• var noun_type_creatable_asset = new CmdUtils.NounType( "CreatableAsset", ["Story", "Issue", "Defect","Task", "Test","Requirement", "BacklogItem"] );
• var noun_type_asset = new CmdUtils.NounType( "Asset", ["Story", "Issue", "Defect", "Iteration", "Sprint", "Task", "Test", "Requirement", "BacklogItem"] );
• var noun_type_assets = new CmdUtils.NounType( "Assets", ["Stories", "Issues", "Defects", "Iterations", "Sprints", "Tasks", "Tests", "Requirements", "BacklogItems"] );
Commands to:• Jump to locations• Do a free text search• Structured search
– My todos– Open items
![Page 12: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/12.jpg)
Ideas
• Augment a page with data from another source
• Use Firefox “Places” (history/marks)
![Page 13: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/13.jpg)
Caveats• Frustrating developer experience– Error messages don’t have line numbers!
• Security issues• Current release is 1.1– 1.2 shortly– https://wiki.mozilla.org/Labs/Ubiquity/
Ubiquity_0.1.2_Release_Notes_(Raging_Stream)• A bit ugly• To be determined: – Is a command line usable by my mom?
![Page 14: Bar Camp Ubiquity Presentation](https://reader036.vdocument.in/reader036/viewer/2022082921/5560cb04d8b42a13088b4ab9/html5/thumbnails/14.jpg)
Happy Hacking
Andy Edmondshttp://surfmind.com