Technology area | Safari Extensions |
Availability | Available in Safari 5.0 and later. |
Instances of the SafariContentBrowserTabProxy
class serve as proxy objects, allowing scripts injected in the web content to communicate with SafariBrowserTab
objects and the rest of the extension.
The counterpart class, SafariWebPageProxy
, is used to pass messages from outside the web content to the scripts injected into it.
Dispatches a canLoad
message to the browser window tab.
any canLoad (in BeforeLoadEvent event, in any message);
The before-load event you are responding to.
The body of the message. Optional.
Use this method to set up an observer for before-load events and call this method from the observer. Then use the return value to respond to the before-load event, permitting or blocking the resource from being loaded.
This message is sent synchronously, unlike all other messages.
Dispatches a message to the browser window tab.
void dispatchMessage (in DOMString name, in any message);
The name of the message.
The body of the message. Optional.
All messages except for canLoad
messages are dispatched asynchronously. To send a canLoad
message, you should use the canLoad
method.
Sets the user info to the appropriate context information.
void setContextMenuEventUserInfo (in MouseEvent event, in any userInfo);
The event you are responding to.
The context information.
The context information in userInfo
is carried along through the entire event-handling process. It enables you to provide your event handlers with contextual information, such as the user interface element with which the user interacted.
Last updated: 2010-06-30