Skip to content

Instantly share code, notes, and snippets.

@sajirdalas
sajirdalas / Tutorial 10
Created April 10, 2015 12:16
Code written during tutorial 10
//main.js
var cm = require("sdk/context-menu");
var item = cm.Item({
label: "Search on google",
data: "MyId",
//context: cm.PageContext()
//context: cm.URLContext(["*.mozilla.org","*.reddit.com"])
//context: cm.SelectionContext()
@sajirdalas
sajirdalas / Tutorial 9
Created April 10, 2015 10:35
Code examples for Tutorial 9
//silly.js
function sumNumbers(a, b){
return a+b;
}
function sumNumbersAsync(a, b, callback){
var result = a + b;
callback(result);
}