bar camp ubiquity presentation

14
Hacking Ubiquity Presented by Andy Edmon http://surfmind.com

Upload: andy-edmonds

Post on 24-May-2015

1.765 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Bar Camp Ubiquity Presentation

Hacking Ubiquity

Presented by Andy Edmondshttp://surfmind.com

Page 2: Bar Camp Ubiquity Presentation

What is Ubiquity

• Extensible Firefox command line

• Official Mozillalabs project

• Version 0.1.2 (rc5)• 2 months old

Page 3: Bar Camp Ubiquity Presentation

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

Linguistics in Ubiquity

• Verb• Noun• Modifiers

• This– Always refers to current

selection

• Coming Soon– Me– Here

Page 5: Bar Camp Ubiquity Presentation

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

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

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

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

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

FUEL Library

• Preferences• Session Storage• Filesystem• Etc.

Intended to reduce pain (and increase API stability) of Firefox XPCOM

Page 11: Bar Camp Ubiquity Presentation

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

Ideas

• Augment a page with data from another source

• Use Firefox “Places” (history/marks)

Page 13: Bar Camp Ubiquity Presentation

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

Happy Hacking

Andy Edmondshttp://surfmind.com