code fails without focus in tab
mike durakovich <[email protected]>
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <ca18fdea-173b-4335-87e6-a7c7baa7ecea@g19g2000yqe.googlegroups.com> |
I'm trying to port a greasemonkey script to a XPI from scratch because
I need to extend functionality beyond what permissions normally can be
granted through GM. Otherwise I'd use the GM Script compiler and be
happy.
What I have run into is this, unless I am actually on a tab when it
(re)loads, the code doesn't run. If I refresh and maintain focus on
the tab, it runs fine. No focus, no execute. Looking for any help I
can get.
Roughly, this is what I am doing, minus the inner code:
gBrowser.addEventListener("DOMContentLoaded", function(aEvent)
{always(aEvent);}, false);
function always(aEvent) {
if (aEvent.originalTarget instanceof HTMLDocument) {
...
//inner code here does foo
...
}
}