michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIDOMEvent.idl" michael@0: michael@0: /** michael@0: * The nsIDOMMessageEvent interface is used for server-sent events and for michael@0: * cross-domain messaging. michael@0: * michael@0: * For more information on this interface, please see michael@0: * http://www.whatwg.org/specs/web-apps/current-work/#messageevent michael@0: */ michael@0: [scriptable, builtinclass, uuid(bb869a03-5fc0-4a1b-838a-342e5025fc05)] michael@0: interface nsIDOMMessageEvent : nsIDOMEvent michael@0: { michael@0: /** michael@0: * Custom string data associated with this event. michael@0: */ michael@0: [implicit_jscontext] michael@0: readonly attribute jsval data; michael@0: michael@0: /** michael@0: * The origin of the site from which this event originated, which is the michael@0: * scheme, ":", and if the URI has a host, "//" followed by the michael@0: * host, and if the port is not the default for the given scheme, michael@0: * ":" followed by that port. This value does not have a trailing slash. michael@0: */ michael@0: readonly attribute DOMString origin; michael@0: michael@0: /** michael@0: * The last event ID string of the event source, for server-sent DOM events; this michael@0: * value is the empty string for cross-origin messaging. michael@0: */ michael@0: readonly attribute DOMString lastEventId; michael@0: michael@0: /** michael@0: * The window which originated this event. michael@0: */ michael@0: readonly attribute nsIDOMWindow source; michael@0: michael@0: /** michael@0: * Initializes this event with the given data, in a manner analogous to michael@0: * the similarly-named method on the nsIDOMEvent interface, also setting the michael@0: * data, origin, source, and lastEventId attributes of this appropriately. michael@0: */ michael@0: void initMessageEvent(in DOMString aType, michael@0: in boolean aCanBubble, michael@0: in boolean aCancelable, michael@0: in jsval aData, michael@0: in DOMString aOrigin, michael@0: in DOMString aLastEventId, michael@0: in nsIDOMWindow aSource); michael@0: };