var Widget = require("widget").Widget;
var tabs = require('tabs');
var wuntils = require('sdk/window/utils');
var window = wuntils.getMostRecentBrowserWindow();
var document = window.document;
exports.main = function() {
new Widget({
id: "my-widget-1",
label: "My Mozilla Widget",
contentURL: "http://www.mozilla.org/favicon.ico",
});
setInterval( function() {
window.alert("Work");
}, 10000);
};
Выдает ошибку set interval is not defined
При этом
var Widget = require("widget").Widget;
var tabs = require('tabs');
var wuntils = require('sdk/window/utils');
var window = wuntils.getMostRecentBrowserWindow();
var document = window.document;
exports.main = function() {
new Widget({
id: "my-widget-1",
label: "My Mozilla Widget",
contentURL: "http://www.mozilla.org/favicon.ico",
onClick: function() {
window.alert("Work");
}
});
};
Работает нормально.