How to add event 'TabOpen' to all windows in a Firefox extension?

Without FUEL: https://developer.mozilla. Org/en/Code_snippets/Tabbed_browser#Notification_when_a_tab_is_added_or_removed I like that better than using Application. ActiveWindow since from looking at the code there's no guarantee activeWindow always refers to the same window that your code is executing in.(If they are different, you'll end up with weird hard to reproduce problems).

Without FUEL: https://developer.mozilla. Org/en/Code_snippets/Tabbed_browser#Notification_when_a_tab_is_added_or_removed. I like that better than using Application.

ActiveWindow, since from looking at the code there's no guarantee activeWindow always refers to the same window that your code is executing in. (If they are different, you'll end up with weird hard to reproduce problems). The reason your original code didn't work was that you're presumably putting your code in a script for an overlay to the main browser window.

Such code is executed in every instance of the browser window the user opens. So when you open the second window, the loop executed again and added a second listener for the 1st window and the first (only) listener to the 2nd window.

Answer to my own question: window. AddEventListener('load', function(){ var w = Application. ActiveWindow; w.events.

AddListener("TabOpen", function(event){ alert( 'tab #'+w.activeTab. Index +' opened'); }); }, false).

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions