News for hackers. Stuff that matters.
Re:Weird Debugging Tricks the Browser Doesn't Want You to Know by aragonite on Saturday November 11, 2023 @04:38AM (#38228801)
It has some odd behaviors. For example, evaluating the expression

queryObjects(Object.prototype) === queryObjects(Object)

in the console will output 'true', followed by two Arrays of different sizes.

Also, Google's doc [1] says:

> queryObjects(HTMLElement). Returns all HTML elements.

But it returns not just instances of HTMLElement (objects that derive from HTMLElement.prototype via the prototype chain) but subclasses as well (objects that derive from HTMLElement itself via the prototype chain, like HTMLBodyElement and HTMLHeadElement, which are not its instances)

[1] https://developer.chrome.com/docs/devtools/console/utilities...

There are no comments on this comment yet.