mozilla
Your Search Results

    nsIFrameMessageManager

    Provides methods for managing message listeners on local frames. This provides a way for local frames to receive messages from remote frames.
    1.0
    30
    Introduced
    Gecko 2.0
    Obsolete
    Gecko 17.0
    Inherits from: nsISupports Last changed in Gecko 17.0 (Firefox 17.0 / Thunderbird 17.0 / SeaMonkey 2.14)

    Method overview

    void addMessageListener(in AString aMessage, in nsIFrameMessageListener aListener);
    void removeMessageListener(in AString aMessage, in nsIFrameMessageListener aListener);
    void sendAsyncMessage(in AString aMessage, in AString json);

    Methods

    addMessageListener()

    Adds a message listener to the local frame. This listener will receive messages sent from the remote frame.

    void addMessageListener(
      in AString aMessage,
      in nsIFrameMessageListener aListener
    );
    
    Parameters
    aMessage
    The name of the message for which to add a listener.
    aListener
    An object implementing nsIFrameMessageListener whose receiveMessage method will be called when the message is received.

    removeMessageListener()

    Removes a message listener previously added by calling addMessageListener().

    void removeMessageListener(
      in AString aMessage,
      in nsIFrameMessageListener aListener
    );
    
    Parameters
    aMessage
    The name of the message for which to remove a listener.
    aListener
    An object implementing nsIFrameMessageListener to stop receiving messages.

    sendAsyncMessage()

    Asynchronously sends a message to the listeners.

    void sendAsyncMessage(
      in AString aMessage,
      in AString json
    ); 
    
    Parameters
    aMessage
    The name of the message to send to the listeners.
    json Optional
    A JSON object containing data to be delivered to the listeners.

    See also


    Document Tags and Contributors

    Contributors to this page: Sheppy, nikhilm, mnoorenberghe, Laurentj
    Last updated by: mnoorenberghe,