Changes

Jump to: navigation, search

Labs/Ubiquity/Ubiquity 0.1 Author Tutorial

506 bytes added, 18:38, 13 January 2009
m
Adding Commands Programmatically
== Adding Commands Programmatically ==
Here is a snippet of code that shows how a developer can programmatically register a commanded command included in a Firefox extension.
<pre>
}
});
</pre>
 
Note: If you command file needs to include/load other JS files included in your extension, you can use the following piece of code.
 
<pre>
function include( partialURI )
{
// Load JS libraries
var u = "chrome://feedly/content/app/" + partialURI;
try
{
var jsl = Cc["@mozilla.org/moz/jssubscript-loader;1"]
.getService(Ci.mozIJSSubScriptLoader);
jsl.loadSubScript( u );
}
catch( e )
{
throw e;
}
}
 
include( "ubiquity/templates.ubiquity.js" );
</pre>
3
edits

Navigation menu