Re: specifying a specific tab when executing code in an add-on
mike durakovich <[email protected]> Mon, 22 Mar 2010 15:22:56 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <43d8b795-ba23-4039-8142-7ad4b0c07d4a@g28g2000yqh.googlegroups.com> |
On Mar 22, 12:26 pm, johnjbarton <[email protected]> wrote: > 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 Thanks, but I need it to be effective prior to 3.7. Think I got the answer in a different thread, which was to reference aEvent.target in lieu of content.document, which seems to be working as needed.