2018-09-13 23:04:55 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2013-03-14 00:18:36 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* For more information on this interface, please see
|
2017-03-10 04:50:13 +03:00
|
|
|
* https://html.spec.whatwg.org/#messageevent
|
2013-03-14 00:18:36 +04:00
|
|
|
*/
|
|
|
|
|
2019-09-11 17:35:28 +03:00
|
|
|
[Exposed=(Window,Worker)]
|
2013-09-11 18:10:01 +04:00
|
|
|
interface MessageEvent : Event {
|
2019-09-11 17:35:28 +03:00
|
|
|
constructor(DOMString type, optional MessageEventInit eventInitDict = {});
|
|
|
|
|
2013-03-14 00:18:36 +04:00
|
|
|
/**
|
|
|
|
* Custom data associated with this event.
|
|
|
|
*/
|
|
|
|
[GetterThrows]
|
|
|
|
readonly attribute any data;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The origin of the site from which this event originated, which is the
|
|
|
|
* scheme, ":", and if the URI has a host, "//" followed by the
|
|
|
|
* host, and if the port is not the default for the given scheme,
|
|
|
|
* ":" followed by that port. This value does not have a trailing slash.
|
|
|
|
*/
|
2017-03-10 04:50:13 +03:00
|
|
|
readonly attribute USVString origin;
|
2013-03-14 00:18:36 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The last event ID string of the event source, for server-sent DOM events; this
|
|
|
|
* value is the empty string for cross-origin messaging.
|
|
|
|
*/
|
|
|
|
readonly attribute DOMString lastEventId;
|
|
|
|
|
|
|
|
/**
|
2015-11-10 09:31:41 +03:00
|
|
|
* The window or port which originated this event.
|
2013-03-14 00:18:36 +04:00
|
|
|
*/
|
2017-03-10 04:50:13 +03:00
|
|
|
readonly attribute MessageEventSource? source;
|
2013-03-14 00:18:36 +04:00
|
|
|
|
2018-04-20 19:55:30 +03:00
|
|
|
[Pure, Cached, Frozen]
|
|
|
|
readonly attribute sequence<MessagePort> ports;
|
|
|
|
|
2013-03-14 00:18:36 +04:00
|
|
|
/**
|
|
|
|
* Initializes this event with the given data, in a manner analogous to
|
2018-04-20 19:55:30 +03:00
|
|
|
* the similarly-named method on the Event interface, also setting the
|
2013-03-14 00:18:36 +04:00
|
|
|
* data, origin, source, and lastEventId attributes of this appropriately.
|
|
|
|
*/
|
2017-04-02 21:16:33 +03:00
|
|
|
void initMessageEvent(DOMString type,
|
|
|
|
optional boolean bubbles = false,
|
|
|
|
optional boolean cancelable = false,
|
|
|
|
optional any data = null,
|
|
|
|
optional DOMString origin = "",
|
|
|
|
optional DOMString lastEventId = "",
|
|
|
|
optional MessageEventSource? source = null,
|
|
|
|
optional sequence<MessagePort> ports = []);
|
2013-09-11 18:10:01 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary MessageEventInit : EventInit {
|
2016-10-25 08:48:05 +03:00
|
|
|
any data = null;
|
|
|
|
DOMString origin = "";
|
|
|
|
DOMString lastEventId = "";
|
2017-03-10 04:50:13 +03:00
|
|
|
MessageEventSource? source = null;
|
2016-10-25 08:48:05 +03:00
|
|
|
sequence<MessagePort> ports = [];
|
2013-03-14 00:18:36 +04:00
|
|
|
};
|
2017-03-10 04:50:13 +03:00
|
|
|
|
|
|
|
typedef (WindowProxy or MessagePort or ServiceWorker) MessageEventSource;
|