dom/interfaces/events/nsIDOMMessageEvent.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/interfaces/events/nsIDOMMessageEvent.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,55 @@
     1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsIDOMEvent.idl"
    1.10 +
    1.11 +/**
    1.12 + * The nsIDOMMessageEvent interface is used for server-sent events and for
    1.13 + * cross-domain messaging.
    1.14 + *
    1.15 + * For more information on this interface, please see
    1.16 + * http://www.whatwg.org/specs/web-apps/current-work/#messageevent
    1.17 + */
    1.18 +[scriptable, builtinclass, uuid(bb869a03-5fc0-4a1b-838a-342e5025fc05)]
    1.19 +interface nsIDOMMessageEvent : nsIDOMEvent
    1.20 +{
    1.21 +  /**
    1.22 +   * Custom string data associated with this event.
    1.23 +   */
    1.24 +  [implicit_jscontext]
    1.25 +  readonly attribute jsval data;
    1.26 +  
    1.27 +  /**
    1.28 +   * The origin of the site from which this event originated, which is the
    1.29 +   * scheme, ":", and if the URI has a host, "//" followed by the
    1.30 +   * host, and if the port is not the default for the given scheme,
    1.31 +   * ":" followed by that port.  This value does not have a trailing slash.
    1.32 +   */
    1.33 +  readonly attribute DOMString origin;
    1.34 +
    1.35 +  /**
    1.36 +   * The last event ID string of the event source, for server-sent DOM events; this
    1.37 +   * value is the empty string for cross-origin messaging.
    1.38 +   */
    1.39 +  readonly attribute DOMString lastEventId;
    1.40 +  
    1.41 +  /**
    1.42 +   * The window which originated this event.
    1.43 +   */
    1.44 +  readonly attribute nsIDOMWindow source;
    1.45 +
    1.46 +  /**
    1.47 +   * Initializes this event with the given data, in a manner analogous to
    1.48 +   * the similarly-named method on the nsIDOMEvent interface, also setting the
    1.49 +   * data, origin, source, and lastEventId attributes of this appropriately.
    1.50 +   */
    1.51 +  void initMessageEvent(in DOMString aType,
    1.52 +                        in boolean aCanBubble,
    1.53 +                        in boolean aCancelable,
    1.54 +                        in jsval aData,
    1.55 +                        in DOMString aOrigin,
    1.56 +                        in DOMString aLastEventId,
    1.57 +                        in nsIDOMWindow aSource);
    1.58 +};

mercurial