Bar Camp Ubiquity Presentation

2,088 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,088
On SlideShare
0
From Embeds
0
Number of Embeds
43
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Bar Camp Ubiquity Presentation

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

×