In ECMAScript specification there is notion of "realms" introduced:
Before it is evaluated, all ECMAScript code must be associated with a realm. Conceptually, a realm consists of a set of intrinsic objects, an ECMAScript global environment, all of the ECMAScript code that is loaded within the scope of that global environment, and other associated state and resources.
In Rauschmayer's book "Speaking JavaScript" author writes about objects which can cross realms:
In web browsers, each frame and window has its own realm with separate global variables. That prevents instanceof from working for objects that cross realms.
What exactly constitutes "realm"? What else besides frame can separate websites code to another realm and what are the consequences?