Skip to content

Instantly share code, notes, and snippets.

@kjgarza
Created February 19, 2012 04:12
Show Gist options
  • Save kjgarza/1861912 to your computer and use it in GitHub Desktop.
Save kjgarza/1861912 to your computer and use it in GitHub Desktop.
myDetector
exports.main = function() {
require("widget").Widget({
id: "widgetID1",
label: "My Mozilla Widget",
contentURL: "http://www.mozilla.org/favicon.ico",
onClick: function(event) {
var XMLHttpRequest = require("xhr");
var request = new XMLHttpRequest();
request.open("GET", "http://www.myexperiment.org/search.xml?query=goble", false);
request.send(null);
if (request.status === 200) {
console.log(request.responseText);
}
}
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment