Class CrossRealmAbstract
Accessors
Staticbrowser
-
Returns CrossRealm.Browser.API
Methods that perform realm-safe checks for DOM elements, browser globals, and Web Platform APIs.
Staticlang
-
Returns CrossRealm.Language.API
Methods that perform realm-safe checks for built-in JavaScript types and core ECMAScript language objects.
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
instanceofcan 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
instanceofchecks when elements are moved between browser windows. With Firefox in particular, the entire JS runtime cannot useinstanceofchecks 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.See