Firefox Addon SDK does not send open event to Popup window
I tried a sample in addon-sdk and found the following behaviour.
Main.js:
var windows = require("sdk/windows").browserWindows; for each (var window in windows) {
console.log(window.title);
} console.log(windows.length); windows.on('open', function(window) {
console.log(windows.length+"open");
});
Using the website http://www.yourhtmlsource.com/javascript/popupwindows.html to test. Go to the section containing the phrase "Try it here: » Pop it", then click on "Pop it", a new winfow is opened but the open event is not triggered (windows.on('open'...); is not called)
Since I am new to Firefox SDK development, could you help me. Thanks.
I tried a sample in addon-sdk and found the following behaviour.
Main.js:
var windows = require("sdk/windows").browserWindows;
for each (var window in windows) {
console.log(window.title);
}
console.log(windows.length);
windows.on('open', function(window) {
console.log(windows.length+"open");
});
Using the website http://www.yourhtmlsource.com/javascript/popupwindows.html to test. Go to the section containing the phrase
"Try it here: » Pop it", then click on "Pop it", a new winfow is opened but the open event is not triggered (windows.on('open'...); is not called)
Since I am new to Firefox SDK development, could you help me. Thanks.
所有回覆 (1)
Try asking in the add-on support forum.