|
1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsIDOMEvent.idl" |
|
7 |
|
8 /** |
|
9 * The nsIDOMMessageEvent interface is used for server-sent events and for |
|
10 * cross-domain messaging. |
|
11 * |
|
12 * For more information on this interface, please see |
|
13 * http://www.whatwg.org/specs/web-apps/current-work/#messageevent |
|
14 */ |
|
15 [scriptable, builtinclass, uuid(bb869a03-5fc0-4a1b-838a-342e5025fc05)] |
|
16 interface nsIDOMMessageEvent : nsIDOMEvent |
|
17 { |
|
18 /** |
|
19 * Custom string data associated with this event. |
|
20 */ |
|
21 [implicit_jscontext] |
|
22 readonly attribute jsval data; |
|
23 |
|
24 /** |
|
25 * The origin of the site from which this event originated, which is the |
|
26 * scheme, ":", and if the URI has a host, "//" followed by the |
|
27 * host, and if the port is not the default for the given scheme, |
|
28 * ":" followed by that port. This value does not have a trailing slash. |
|
29 */ |
|
30 readonly attribute DOMString origin; |
|
31 |
|
32 /** |
|
33 * The last event ID string of the event source, for server-sent DOM events; this |
|
34 * value is the empty string for cross-origin messaging. |
|
35 */ |
|
36 readonly attribute DOMString lastEventId; |
|
37 |
|
38 /** |
|
39 * The window which originated this event. |
|
40 */ |
|
41 readonly attribute nsIDOMWindow source; |
|
42 |
|
43 /** |
|
44 * Initializes this event with the given data, in a manner analogous to |
|
45 * the similarly-named method on the nsIDOMEvent interface, also setting the |
|
46 * data, origin, source, and lastEventId attributes of this appropriately. |
|
47 */ |
|
48 void initMessageEvent(in DOMString aType, |
|
49 in boolean aCanBubble, |
|
50 in boolean aCancelable, |
|
51 in jsval aData, |
|
52 in DOMString aOrigin, |
|
53 in DOMString aLastEventId, |
|
54 in nsIDOMWindow aSource); |
|
55 }; |