SafariExtensionMessageEvent Class Reference

Inherits from
Technology area
Safari Extensions
Availability
Available in Safari 5.0 and later.

Overview

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.

Tasks

Working with Messages

Properties

message

The message data.

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

name

The name of the message.

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