3 ms·
In case someone else is also confused by this, it seems that instanceof checks whether the objects prototype matches, and these prototypes are not shared across
by suyjuris 6y ago
In case someone else is also confused by this, it seems that instanceof checks whether the objects prototype matches, and these prototypes are not shared across different contexts, which iframes are [0]. (Though I would still like to know why it works like this.)
[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof#Description https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- odensc 6y agoFor security reasons - you can modify the prototypes and you wouldn't want iframes to inherit that.