Safari Developer Library

Developer

SafariExtensionMessageEvent Class Reference

Options
Deployment Target:

On This Page

SafariExtensionMessageEvent

Instances of the SafariExtensionMessageEvent encapsulate a message being passed. Message passing is the only way to communicate information from inside the web content area to scripts running outside of it, and vice versa.

The event type for this class is message.

Inheritance


Conforms To


Not Applicable

Import Statement


Not Applicable Not Applicable

Availability


Available in Safari 5.0 and later.
  • name Property

    The name of the message.

    Declaration

    JavaScript

    readonly attribute DOMString name

    Discussion

    There is no fixed meaning to the name of a message; it is up to the programmer to decide how messages should be named within an extension.

    A message’s name must not be the empty string. The message name canLoad is used by the SafariContentBrowserTabProxy method canLoad; you should not send messages with this name.

    Availability

    Available in Safari 5.1 and later.

  • message Property

    The message data.

    Declaration

    JavaScript

    attribute any message

    Discussion

    This attribute is optional; if you don’t need it you can set it to undefined or null, or not set any value.

    The data can be any scalar value, or any object that conforms to the W3C standard for safe passing of structured cloned data.

    Availability

    Available in Safari 5.1 and later.