HTMLCollection issue #1530

w35l3y opened this Issue Mar 28, 2012 · 1 comment


None yet

2 participants

w35l3y commented Mar 28, 2012
var _elements = document.forms[0].elements,
_collections = [HTMLCollection, unsafeWindow.HTMLCollection, window.HTMLCollection];
// returns true,true,false
// i suppose it should return true,true,true
alert( (v) {
    return !!v;

// returns false, true, "invalid 'instanceof' operand _i"
// i suppose it should return true, true, true
for each (var _i in _collections) {
    alert(_elements instanceof _i);

I am using Firefox 11.0 and Greasemonkey 0.9.18

(_elements instanceof HTMLCollection) was returning true before Firefox 11.0


I'm running: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0) Gecko/20100101 Firefox/10.0

My script says:

var e = document.links;
dump('e instanceof HTMLCollection: ' + (e instanceof HTMLCollection) + '\n');
dump('e instanceof unsafeWindow.HTMLCollection: ' + (e instanceof unsafeWindow.HTMLCollection) + '\n');
dump('e instanceof window.HTMLCollection: ' + (e instanceof window.HTMLCollection) + '\n');

I see in the console:

e instanceof HTMLCollection: false
e instanceof unsafeWindow.HTMLCollection: true

Then in the error console:

Mon Apr 23 2012 12:28:55
Error: invalid 'instanceof' operand window.HTMLCollection
Source file: file:///.../gm_scripts/elements_test/elements_test.user.js
Line: 11

This isn't new. And I don't think there's really anything we can do. I'd suggest you investigate

@arantius arantius closed this Apr 23, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment