Simple use case:
main.js
var tabs = require('sdk/tabs');
tabs.open({
url: 'http://www.openstreetmap.org',
onOpen: function (tab) {
tab.attach({
contentScriptFile: './content.js'
});
}
});
content.js
console.log("foo");
setInterval(function() {
console.log("bar");
}, 1000);
output
foo
I get the same problem with event handlers, which is more problematic…