Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

Mozilla サポートの検索

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

このスレッドはアーカイブに保管されました。 必要であれば新たに質問してください。

Open event is not triggered with popup window

  • 1 件の返信
  • 1 人がこの問題に困っています
  • 6 回表示
  • 最後の返信者: the-edmeister

more options

I am developing a Firefox add-on using Add-on SDK tool. I am doing something as soon as a tab is opened. I registered for all tab's event( open,ready,close).

   var tabs = require("sdk/tabs");
   tabs.on("open",openTab);
   tabs.on("ready",readyTab);
   tabs.on("close",closeTab);

And i have respective functions for each event Listener. Problem which i am facing is some of the webpages opened in a new window. For those web pages none of the event Listener is firing. Please help me out in this.

By debugging the following function at resource://gre/modules/commonjs/sdk/tabs/tabs-firefox.js

// Detect tabs in new windows windowObserver.on('open', domWindow => {

 if (!isBrowser(domWindow) || ignoreWindow(domWindow))
   return;
 let window = null;
 try {
   modelFor(domWindow);
 }
 catch (e) { }
 for (let tabElement of getTabs(domWindow)) {
   addWindowTab(window, tabElement);
 }

});


When I go to the page "http://www.yourhtmlsource.com/javascript/popupwindows.html", then go to the line "Try it here: » Pop it" and lick on "Pop it", a new popup window appeared, and I found that the function isBrowser(domWindow) always returns FALSE with the popup window.

Please help me the way to make addon SDK make isBrowser(domWindow) return TRUE.

I am developing a Firefox add-on using Add-on SDK tool. I am doing something as soon as a tab is opened. I registered for all tab's event( open,ready,close). var tabs = require("sdk/tabs"); tabs.on("open",openTab); tabs.on("ready",readyTab); tabs.on("close",closeTab); And i have respective functions for each event Listener. Problem which i am facing is some of the webpages opened in a new window. For those web pages none of the event Listener is firing. Please help me out in this. By debugging the following function at resource://gre/modules/commonjs/sdk/tabs/tabs-firefox.js // Detect tabs in new windows windowObserver.on('open', domWindow => { if (!isBrowser(domWindow) || ignoreWindow(domWindow)) return; let window = null; try { modelFor(domWindow); } catch (e) { } for (let tabElement of getTabs(domWindow)) { addWindowTab(window, tabElement); } }); When I go to the page "http://www.yourhtmlsource.com/javascript/popupwindows.html", then go to the line "Try it here: » Pop it" and lick on "Pop it", a new popup window appeared, and I found that the function isBrowser(domWindow) always returns FALSE with the popup window. Please help me the way to make addon SDK make isBrowser(domWindow) return TRUE.

すべての返信 (1)

more options

Add-on support is over here: https://discourse.mozilla-community.org/c/add-ons

Or you could search the Mozilla Developer Network form an answer. https://developer.mozilla.org/en-US/