Skip to content


Subversion checkout URL

You can clone with
Download ZIP


mozMatchesSelector issue using GM + Firefox 4 #1300

Kambfhase opened this Issue · 1 comment

2 participants


There is some weirdness using mozMatchesSelector in a GM-script in Firefox 4: 
  unsafeWindow.document.createElement('div'), 'div') // false, should be true

I created a userscript that contains more test cases:
Go to* 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


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.