CrossOriginWindow class

A safe wrapper for a cross-origin window.

Since cross-origin access is limited by the browser, the Dart runtime can't provide a type for or null-assert the cross-origin window. To safely interact with the cross-origin window, use this wrapper instead.

The dart:html equivalent is _DOMWindowCrossFrame.

Only includes allowed APIs from the W3 spec located here: https://html.spec.whatwg.org/multipage/nav-history-apis.html#crossoriginproperties-(-o-) Some browsers may provide more access.

Properties

closed bool
The Window.closed value of this cross-origin window.
no setter
hashCode int
The hash code for this object.
no setterinherited
length int
The Window.length value of this cross-origin window.
no setter
location CrossOriginLocation?
A CrossOriginLocation wrapper of the Window.location value of this cross-origin window.
no setter
opener CrossOriginWindow?
A CrossOriginWindow wrapper of the Window.opener value of this cross-origin window.
no setter
parent CrossOriginWindow?
A CrossOriginWindow wrapper of the Window.top value of this cross-origin window.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
top CrossOriginWindow?
A CrossOriginWindow wrapper of the Window.parent value of this cross-origin window.
no setter
unsafeWindow JSAny?
The unsafe window value that this wrapper wraps that should only ever be typed as JSAny?.
no setter

Methods

blur() → void
Calls Window.blur on this cross-origin window.
close() → void
Calls Window.close on this cross-origin window.
focus() → void
Calls Window.focus on this cross-origin window.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
postMessage(JSAny? message, [JSAny? optionsOrTargetOrigin, JSArray<JSObject>? transfer]) → void
Calls Window.postMessage on this cross-origin window with the given message, optionsOrTargetOrigin if not null, and transfer if not null.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited