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 ніколи не просить вас зателефонувати, надіслати номер телефону у повідомленні або поділитися з кимось особистими даними. Будь ласка, повідомте про підозрілі дії за допомогою меню “Повідомити про зловживання”

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/