Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You should only have to register for the event once, and you should receive it every time a browser tab fires it.</p> <p>Your code should work just fine, provided you are waiting for the XUL window to fire its <code>load</code> event before adding an event listener to the gBrowser element. If you are adding an event listener before that, gBrowser is not yet initialized, and the behavior is undefined.</p> <p>Here is an example:</p> <pre><code>window.addEventListener('load', function () { gBrowser.addEventListener('DOMContentLoaded', function () { // stuff that happens for each web page load goes here }, false); }, false); </code></pre> <p>Note that in practice I can only be sure this works with Firefox 3.5 and up. I wrote an extension (internal to my company) that does this sort of thing reliably for Firefox 1.5 through 3.5, but it is unfortunately a bit more complicated (and fortunately) much more robust than the solution above. If you need support for more than Firefox 3.5+, let me know and I'll provide more info.</p> <p>Here is some additional reading:</p> <ul> <li><a href="https://developer.mozilla.org/en/Code_snippets/On_page_load" rel="nofollow noreferrer">https://developer.mozilla.org/en/Code_snippets/On_page_load</a></li> <li><a href="https://developer.mozilla.org/en/Code_snippets/Tabbed_browser" rel="nofollow noreferrer">https://developer.mozilla.org/en/Code_snippets/Tabbed_browser</a></li> <li><a href="https://developer.mozilla.org/en/Listening_to_events_on_all_tabs" rel="nofollow noreferrer">https://developer.mozilla.org/en/Listening_to_events_on_all_tabs</a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload