WebPlugIn Protocol Reference
(informal protocol)
| Framework | /System/Library/Frameworks/WebKit.framework |
| Availability | Available in OS X v10.3.9 and later. |
| Declared in | WebPlugin.h |
| Companion guides |
Overview
The WebPlugIn informal protocol defines methods that enable interaction between an application using the WebKit framework and any WebKit-based plug-ins it may use.
Tasks
Accessing the Scripting Environment
Using Plug-in State Information
Controlling the Plug-in
Main Resource Messages
Instance Methods
objectForWebScript
Returns an object that exposes the plug-in’s scripting interface.
Return Value
An object representing the plug-in’s scripting interface.
Discussion
The methods of the object are exposed to the script environment. Messages sent to the returned object will be invoked in the scripting environment. See the WebScripting Protocol Reference informal protocol for more details.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebPlugin.hwebPlugInDestroy
Prepares the plug-in for deallocation.
Discussion
Typically, this method frees the memory and other resources used by the plug-in. For example, if the plug-in had a copy of a WebPlugInContainer object, this method should relinquish ownership of that object. Do not send any other messages to the plug-in after invoking this method, because calling this method destroys the plug-in. No other methods in this interface may be called after the application has called this method.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebPlugin.hwebPlugInInitialize
Initializes the plug-in.
Discussion
Tells the plug-in to perform one-time initialization. This method must be called only once per instance of the plug-in object, before any other methods in the protocol are called.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebPlugin.hwebPlugInMainResourceDidFailWithError:
Invoked when an error occurs loading the main resource.
Parameters
- error
An error object containing details of why the connection failed to load the request successfully.
Discussion
This message is invoked when the underlying NSURLConnection object for the main resource sends the connection:didFailWithError: message to its delegate.
Availability
- Available in OS X v10.6 and later.
Declared In
WebPlugin.hwebPlugInMainResourceDidFinishLoading
Invoked when the connection successfully finishes loading data.
Discussion
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to NO and the underlying NSURLConnection object for the main resource sends the connectionDidFinishLoading: message to its delegate.
Availability
- Available in OS X v10.6 and later.
Declared In
WebPlugin.hwebPlugInMainResourceDidReceiveData:
Invoked when the connection loads data incrementally.
Parameters
- data
The newly available data.
Discussion
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to NO and the underlying NSURLConnection object for the main resource sends the connection:didReceiveData: message to its delegate.
Availability
- Available in OS X v10.6 and later.
Declared In
WebPlugin.hwebPlugInMainResourceDidReceiveResponse:
Invoked when the connection receives sufficient data to construct the URL response for its request.
Parameters
- response
The URL response for the connection's request.
Discussion
This message is invoked when the WebPlugInShouldLoadMainResourceKey plug-in command-line argument is set to NO and the underlying NSURLConnection object for the main resource sends the connection:didReceiveResponse: message to its delegate.
Availability
- Available in OS X v10.6 and later.
Declared In
WebPlugin.hwebPlugInSetIsSelected:
Controls plug-in behavior based on its selection.
Parameters
- isSelected
If
YES, the plug-in is currently selected. Otherwise, it is not selected.
Discussion
This may be used, for example, to change the plug-in’s appearance when it is selected by the user.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebPlugin.hwebPlugInStart
Tells the plug-in to start normal operation.
Discussion
The plug-in usually begins its primary task (such as drawing, playing sounds, or animating) in this method. This method may be called more than once, provided that the application has already called webPlugInInitialize and that each call to this method is followed later by a call to webPlugInStop.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebPlugin.hwebPlugInStop
Tells the plug-in to stop normal operation.
Discussion
This method may be called more than once, provided that the application has already called webPlugInInitialize and that each call to this method is preceded by a call to webPlugInStart.
Availability
- Available in OS X v10.3.9 and later.
Declared In
WebPlugin.h© 2010 Apple Inc. All Rights Reserved. (Last updated: 2010-02-24)