Skip to content
This repository

mozMatchesSelector issue using GM + Firefox 4 #1300

Open
Kambfhase opened this Issue March 02, 2011 · 1 comment

2 participants

Frank Hase janekptacijarabaci
Frank Hase

There is some weirdness using mozMatchesSelector in a GM-script in Firefox 4:

unsafeWindow.document.documentElement.mozMatchesSelector.call( 
  unsafeWindow.document.createElement('div'), 'div') // false, should be true

I created a userscript that contains more test cases: http://userscripts.org/scripts/review/98151
Go to https://www.mozilla.org/* and look into the console. It will most likely contain [ true, false, false, false]. Using Firefox 3.6 with the same setup gives [true, true, false, false]. I have also been checking 4b11, 4b10 and they also yield the wrong result.

I know that is likely to a change in Fx 4 but I don't know enough about GMs internal architecture( XPCNativeWrapper) to dig deeper. This code might look like an edge-case but it is the pattern used by recent jQuery to match elements against selectors. So this will prevent people from being able to use jQuery in user scripts.

Maybe one of you has an idea what is wrong here.

mfG Kambfhase

janekptacijarabaci

Firefox 20.0 - [true, true, true, true]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.