Re: specifying a specific tab when executing code in an add-on
johnjbarton <[email protected]> Mon, 22 Mar 2010 09:26:32 -0700
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
On 3/22/2010 9:13 AM, mike durakovich wrote:
> I am creating an add-on that has an issue of focus. If I have
> multiple tabs running in parallel that all trigger the add-on
> simultaneously on load, all the code will be executed against the tab
> that has focus.
>
> Using the following to listen for the page load:
>
> gBrowser.addEventListener("DOMContentLoaded", function(aEvent)
> {always(aEvent);}, false);
>
> So, the issue is that the code is being triggered on a tab load, but
> isn't executing in the calling tab, just the tab with focus. How can
> I specify a particular tab of unknown index to execute the code in,
> regardless if that tab has focus or not?
For FF 3.7, you can use content-document-global-created event from Bug
549539.
In Firebug we use onLocationChange events and we try to avoid dealing
with tabs if possible.
jjb