Prohledat stránky podpory

Vyhněte se podvodům. Za účelem poskytnutí podpory vás nikdy nežádáme, abyste zavolali nebo poslali SMS na nějaké telefonní číslo nebo abyste sdělili své osobní údaje. Jakékoliv podezřelé chování nám prosím nahlaste pomocí odkazu „Nahlásit zneužití“.

Learn More

Open event is not triggered with popup window

  • 1 odpověď
  • 1 má tento problém
  • 6 zobrazení
  • Poslední odpověď od 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.

Všechny odpovědi (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/