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

Categories

(Firefox :: Extension Compatibility, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED INVALID

People

(Reporter: erikvvold, Unassigned)

References

()

Details

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 = http://github.com/erikvold/scriptish/blob/wtf/content/browser.js#L63 ):

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 https://erikvold@github.com/erikvold/scriptish.git
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: http://github.com/erikvold/scriptish/commit/5de28e356692b144c1e18e688de2fa6c869739d6
This error seems to first appear on 7/16. Checked w/ GM not Scriptish.
20100716065013 is okay
20100716070248 not okay

http://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=ced41ebe9e75&tochange=8951841a4cda

"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:
http://github.com/arantius/greasemonkey/tree/firefox4

It is this branch which exhibits the behavior described.  Reference the greasemonkey-dev thread about this topic:
http://groups.google.com/group/greasemonkey-dev/t/d23fc395360ae5dd
Verified previous comments against:
> http://github.com/arantius/greasemonkey/tree/firefox4

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(source.id); 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:

http://github.com/erikvold/scriptish/commit/a7c48695fe59965edf453a990e246e139554cfc2

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!).

best
Dan
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:
http://github.com/downloads/arantius/greasemonkey/greasemonkey-0.8.20100805.7.xpi
Thanks for the new build of Greasemonkey! I got here from the link on the Google Group (http://groups.google.com/group/greasemonkey-users/browse_thread/thread/a460e73f4764aec), so I thought this bug had something to do with it.
tnx auriam@gmail.com 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.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.