postMessage property

({void Function([dynamic message, WindowPostMessageOptions? options]) $1, void Function(dynamic message, String targetOrigin, [List<Object>? transfer]) $2}) get postMessage

Overload accessor: $1, $2

Implementation

({
  /// Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.
  ///
  /// Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.
  ///
  /// A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.
  ///
  /// If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".
  ///
  /// Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned.
  ///
  /// [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/postMessage)
  void Function([
    _i2.dynamic message,
    _i3.WindowPostMessageOptions? options,
  ]) $1,

  /// Posts a message to the given window. Messages can be structured objects, e.g. nested objects and arrays, can contain JavaScript values (strings, numbers, Date objects, etc), and can contain certain data objects such as File Blob, FileList, and ArrayBuffer objects.
  ///
  ///  Objects listed in the transfer member of options are transferred, not just cloned, meaning that they are no longer usable on the sending side.
  ///
  ///  A target origin can be specified using the targetOrigin member of options. If not provided, it defaults to "/". This default restricts the message to same-origin targets only.
  ///
  ///  If the origin of the target window doesn't match the given target origin, the message is discarded, to avoid information leakage. To send the message to the target regardless of origin, set the target origin to "*".
  ///
  ///  Throws a "DataCloneError" DOMException if transfer array contains duplicate objects or if message could not be cloned.
  ///
  ///  [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/postMessage)
  void Function(
    _i2.dynamic message,
    _i2.String targetOrigin, [
    _i2.List<_i2.Object>? transfer,
  ]) $2,
}) get postMessage => (
      $1: _postMessage$1,
      $2: _postMessage$2,
    );