Closed Bug 581724 Opened 10 years ago Closed 7 years ago

addEventListener for 'DOMContentLoaded' to the id='appcontent' element is causing an error FF 4.0b3pre


(Firefox :: Extension Compatibility, defect)

Not set





(Reporter: erikvvold, Unassigned)




User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_4; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4
Build Identifier: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b3pre) Gecko/20100724 Minefield/4.0b3pre

This is a bit complicated to explain, but here it goes..

I contribute to GM, and this error applies for that extension as well, but I'm going to point you to the source code for my GM fork, Scriptish.

The summary is that this line always used to work, and now with the new nightly, FF 4.0b3pre, this line causes the following error (this line = ):

Error: uncaught exception: [Exception... "Component returned failure code: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS) [nsIXPCComponents_Utils.lookupMethod]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: chrome://greasemonkey/content/utils.js :: GM_listen :: line 44"  data: no]

Also you'll notice there are lines below that falling line that look similar, well they still work fine, it's just the specific line that I'm point to that's failing, and I think it has something to do with the element being used.

Reproducible: Always

Steps to Reproduce:
1. git clone
2. git checkout fd028dfe94bf3e23ad864c0c90275714bed58710
3. add this extension to a ff profile by creating a file in the profile's extension folder that points to your clone
4. boot up firefox (make sure that Scriptish is installed and enabled)
5. If scriptish is installed properly and it's enabled, then you will see the following error in the error console:

Error: uncaught exception: [Exception... "Component returned failure code: 0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS) [nsIXPCComponents_Utils.lookupMethod]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: chrome://greasemonkey/content/utils.js :: GM_listen :: line 44"  data: no]
Actual Results:  
An error.

Expected Results:  
No error.

Oddly this commit seems to fix the bug:
This error seems to first appear on 7/16. Checked w/ GM not Scriptish.
20100716065013 is okay
20100716070248 not okay

"Fix" didn't seem to do anything for me w/ GM.
What version of GM did you use? the 0.8.x versions won't work, nor will the nightly (b/c they don't have any of the other FF4 compatability fixes that I've implemented of scriptish)..
I was testing w/ recent/current pull from master branch.
Greasemonkey master is not currently even attempted to be Firefox 4 compatible.  The most patches are currently merged in here:

It is this branch which exhibits the behavior described.  Reference the greasemonkey-dev thread about this topic:
Verified previous comments against:

Mozilla/5.0 (Windows; Windows NT 6.1; WOW64; rv:2.0b3pre) Gecko/20100726 Minefield/4.0b3pre
Ah you're right Matthew, just touching the source wasn't enough. I stumbled upon this 'fix' while trying to figure when this error was actually occurring by doing a GM_log(; w/in GM_listen at which point I no longer got any errors, and things started working. I was trying to reduce the 'fix' but it seems I need to disable > restart > enable > restart after many changes and I may have forgotten to do this, which lead me to think that just touching the source was enough.. try the following changes instead though please:

This 'fix' however is a side/non issue the error is the real issue.
A former Greasemonkey user here hoping FF gets fixed soon... since I'm using 4.0b2 and don't want to go back to 3.6 (a lot slower!).

Correction: For Greasemonkey, at least, addEventListener has nothing to do with it.  As the error pasted into the original description shows, this is a problem with lookupMethod.

In modern versions of Greasemonkey, which only run on modern versions of Firefox, the object having its method looked up is already an XPCNW, so this call is unnecessary, and I removed it to work around this bug.

Thid build, like the betas of Firefox, is *only intended for testing*, but because I'm a pragmatist, I'll at least link it:
Thanks for the new build of Greasemonkey! I got here from the link on the Google Group (, so I thought this bug had something to do with it.
tnx this build mostly works
Please, can you provide a link for 4.0b5 ?
Thanks in advance.
"Please, can you provide a link for 4.0b5 ?"

A link to what exactly?
Sorry for the lack of information.
At Anthony Lieuallen last post he linked a greasemonkey xpi for firefox 4.0b3, I was asking it for 4.0b5, but I just changed the xml inside (which I didn't knew about at the time of my post) and it works in b5 too.
Sorry for the unnecessary bothering.
Not sure this matters anymore.
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.