Hi, For a long time Firefox's behaviour for instanceof checks on DOM objects, when the right-hand side interface object comes from a different window from the object on the left, has differed from other browsers. For example,
otherWindow.document instanceof Node evaluates to true in Firefox and false in other browsers. Recently, Web IDL has been updated to return false for cross-context instanceof checks like this. Fixing this (bug 1360715) is not a small project, since there are many places in chrome code where we rely on instanceof working cross-context. It is a useful check to be able to do, so at some point we'll likely extend Web IDL with a way to do this, but for now there is no standardised way to do so. For use in the meantime, I just landed bug 1428531 on inbound, which adds a new chrome-only static method "isInstance" to Web IDL defined interfaces, so you can write for example: Document.isInstance(otherWindow.document) So that we don't have even more call sites we need to fix up once we start looking at bug 1360715, please try to use isInstance rather than instanceof if you need to do cross-context DOM object tests from chrome JS. Thanks, Cameron _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform