Safari Developer Library


SafariExtensionMessageEvent Class Reference

Deployment Target:

On This Page


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.

  • name Property

    The name of the message.


    readonly attribute DOMString name


    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.

  • message Property

    The message data.


    attribute any message


    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.