[Project_owners] Either calling a function from chrome or

Jesper Staun Hansen jesper at heroes-addon.dk
Thu Oct 9 20:12:19 PDT 2008


JS code in addon: http://pastebin.mozilla.org/551714
XUL code opened in window and processed by addon code above: 
http://pastebin.mozilla.org/551717

Results in:
Fired DOMContentLoaded!
Target!
Fired DOMContentLoaded!
Target!
Fired DOMContentLoaded!
Target!
Fired DOMContentLoaded!
Target!
Fired DOMContentLoaded!
Target!
Fired inline!
Fired DOMContentLoaded!
Target!
Fired onload!

The order seems to be:
1. inline
2. DOMContentLoaded
3. onload=""

So inline code should be in place... However line 14 in the JS code 
results in
   "Error: event.originalTarget.defaultView.whopzer is not a function"
If I try to do the same in JSShell with a globalevent (var globalevent 
outside and globalevent = event inside) and do 
globalevent.originalTarget.defaultView.whopzer("test\n") then it dumps 
"Fired test\n"
So alright, I go ahead a put EventListeners on the doc at line 12 
(#document) and 13 (<window>). These doesn't fire at all.

Any ideas to getting the inline function whopzer fired from the addon?



More information about the Project_owners mailing list