Class CrossRealmAbstract

Provides cross-realm checks for DOM nodes / elements, events, and essential duck typing for any class-based object with a constructor name. A realm is an execution environment with its own global object and intrinsics; values created in different realms do not share prototypes, so checks like instanceof can fail across realms. This includes sharing JS code across browser windows.

The impetus is that certain browsers such as Chrome and Firefox behave differently when performing instanceof checks when elements are moved between browser windows. With Firefox in particular, the entire JS runtime cannot use instanceof checks as the instances of fundamental DOM elements differ between windows.

TRL supports moving applications from a main central browser window and popping them out into separate standalone app instances in a separate browser window. In this case, for essential DOM element and event checks, it is necessary to employ the workarounds found in CrossRealm.

Index