FreeWRL / FreeX3D 4.3.0
nsIPluginHost Interface Referenceabstract
Inheritance diagram for nsIPluginHost:

Public Member Functions

void init ()
 
void destroy ()
 
void loadPlugins ()
 
void reloadPlugins (in boolean reloadPages)
 Causes the plugins directory to be searched again for new plugin libraries.
 
nsIPlugin getPlugin (in string aMimeType)
 
void instantiateEmbeddedPlugin (in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner)
 
void instantiateFullPagePlugin (in string aMimeType, in nsIURI aURI, in nsIStreamListenerRef aStreamListener, in nsIPluginInstanceOwner aOwner)
 
nsIStreamListener instantiatePluginForChannel (in nsIChannel aChannel, in nsIPluginInstanceOwner aOwner)
 Instantiate an embedded plugin for an existing channel.
 
void setUpPluginInstance (in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner)
 
void isPluginEnabledForType (in string aMimeType)
 
void isPluginEnabledForExtension (in string aExtension, in constCharStarRef aMimeType)
 
void getPlugins (in unsigned long aPluginCount, out nsIDOMPlugin aPluginArray)
 
void getPluginTags (out unsigned long aPluginCount, [retval, array, size_is(aPluginCount)] out nsIPluginTag aResults)
 
void stopPluginInstance (in nsIPluginInstance aInstance)
 
void handleBadPlugin (in PRLibraryPtr aLibrary, in nsIPluginInstance instance)
 
NS_IMETHOD GetURL (nsISupports *pluginInst, const char *url, const char *target=NULL, nsIPluginStreamListener *streamListener=NULL, const char *altHost=NULL, const char *referrer=NULL, PRBool forceJSEnabled=PR_FALSE)=0
 Fetches a URL.
 
NS_IMETHOD PostURL (nsISupports *pluginInst, const char *url, PRUint32 postDataLen, const char *postData, PRBool isFile=PR_FALSE, const char *target=NULL, nsIPluginStreamListener *streamListener=NULL, const char *altHost=NULL, const char *referrer=NULL, PRBool forceJSEnabled=PR_FALSE, PRUint32 postHeadersLength=0, const char *postHeaders=NULL)=0
 Posts to a URL with post data and/or post headers.
 
void findProxyForURL (in string aURL, out string aResult)
 Returns the proxy info for a given URL.
 
void UserAgent (in nativeChar resultingAgentString)
 
void setIsScriptableInstance (in nsIPluginInstance aInstance, in boolean aScriptable)
 To notify the plugin manager that the plugin created a script object.
 
void parsePostBufferToFixHeaders (in string aInPostData, in unsigned long aInPostDataLen, out string aOutPostData, out unsigned long aOutPostDataLen)
 This method parses post buffer to find out case insensitive "Content-length" string and CR or LF some where after that, then it assumes there is http headers in the input buffer and continue to search for end of headers (CRLFCRLF or LFLF).
 
void createTmpFileToPost (in string aPostDataURL, out string aTmpFileName)
 To create tmp file with Content len header in, it will use by http POST.
 
void newPluginNativeWindow (out nsPluginNativeWindowPtr aPluginNativeWindow)
 Creates a new plugin native window object.
 
void deletePluginNativeWindow (in nsPluginNativeWindowPtr aPluginNativeWindow)
 Deletes plugin native window object created by NewPluginNativeWindow.
 
void instantiateDummyJavaPlugin (in nsIPluginInstanceOwner aOwner)
 Instantiate a "dummy" java plugin if a java plugin that supports NPRuntime is installed.
 
void getPluginName (in nsIPluginInstance aInstance, [shared] out string aPluginName)
 Get the plugin name for the plugin instance.
 
nsIPluginTag getPluginTagForInstance (in nsIPluginInstance aInstance)
 Get the plugin tag associated with a given plugin instance.
 

Data Fields

readonly attribute unsigned long pluginCount
 

Detailed Description

Definition at line 69 of file nsIPluginHost.idl.

Member Function Documentation

◆ findProxyForURL()

void nsIPluginHost::findProxyForURL ( in string aURL,
out string aResult )

Returns the proxy info for a given URL.

The caller is required to free the resulting memory with nsIMalloc::Free. The result will be in the following format

i) "DIRECT" – no proxy ii) "PROXY xxx.xxx.xxx.xxx" – use proxy iii) "SOCKS xxx.xxx.xxx.xxx" – use SOCKS iv) Mixed. e.g. "PROXY 111.111.111.111;PROXY 112.112.112.112", "PROXY 111.111.111.111;SOCKS 112.112.112.112"....

Which proxy/SOCKS to use is determined by the plugin.

◆ getPluginName()

void nsIPluginHost::getPluginName ( in nsIPluginInstance aInstance,
[shared] out string aPluginName )

Get the plugin name for the plugin instance.

Parameters
aInstancethe plugin instance object
aPluginNamereturns a pointer to a shared readonly string value, it's only valid for the lifetime of the plugin instance - you must copy the string value if you need it longer than that.

◆ getPluginTagForInstance()

nsIPluginTag nsIPluginHost::getPluginTagForInstance ( in nsIPluginInstance aInstance)

Get the plugin tag associated with a given plugin instance.

Parameters
aInstancethe plugin instance object
Returns
plugin tag object

◆ GetURL()

NS_IMETHOD nsIPluginHost::GetURL ( nsISupports * pluginInst,
const char * url,
const char * target = NULL,
nsIPluginStreamListener * streamListener = NULL,
const char * altHost = NULL,
const char * referrer = NULL,
PRBool forceJSEnabled = PR_FALSE )
pure virtual

Fetches a URL.

(Corresponds to NPN_GetURL and NPN_GetURLNotify.)

Parameters
pluginInst- the plugin making the request. If NULL, the URL is fetched in the background.
url- the URL to fetch
target- the target window into which to load the URL, or NULL if the data should be returned to the plugin via streamListener.
streamListener- a stream listener to be used to return data to the plugin. May be NULL if target is not NULL.
altHost- an IP-address string that will be used instead of the host specified in the URL. This is used to prevent DNS-spoofing attacks. Can be defaulted to NULL meaning use the host in the URL.
referrer- the referring URL (may be NULL)
forceJSEnabled- forces JavaScript to be enabled for 'javascript:' URLs, even if the user currently has JavaScript disabled (usually specify PR_FALSE)
Returns
- NS_OK if this operation was successful

◆ instantiateDummyJavaPlugin()

void nsIPluginHost::instantiateDummyJavaPlugin ( in nsIPluginInstanceOwner aOwner)

Instantiate a "dummy" java plugin if a java plugin that supports NPRuntime is installed.

This plugin is used for exposing window.java and window.Packages. If the java plugin supports NPRuntime and instantiation was successful, aOwners instance will be non-null, if not, it will be null.

◆ instantiatePluginForChannel()

nsIStreamListener nsIPluginHost::instantiatePluginForChannel ( in nsIChannel aChannel,
in nsIPluginInstanceOwner aOwner )

Instantiate an embedded plugin for an existing channel.

The caller is responsible for opening the channel. It may or may not be already opened when this function is called.

◆ parsePostBufferToFixHeaders()

void nsIPluginHost::parsePostBufferToFixHeaders ( in string aInPostData,
in unsigned long aInPostDataLen,
out string aOutPostData,
out unsigned long aOutPostDataLen )

This method parses post buffer to find out case insensitive "Content-length" string and CR or LF some where after that, then it assumes there is http headers in the input buffer and continue to search for end of headers (CRLFCRLF or LFLF).

It will always malloc() output buffer (caller is responsible to free it) if input buffer starts with LF, which comes from 4.x spec http://developer.netscape.com/docs/manuals/communicator/plugin/pgfn2.htm#1007754 "If no custom headers are required, simply add a blank line ('\n') to the beginning of the file or buffer.", it skips that '
' and considers rest of the input buffer as data. If "Content-length" string and end of headers is found it substitutes single LF with CRLF in the headers, so the end of headers always will be CRLFCRLF (single CR in headers, if any, remain untouched) else it puts "Content-length: "+size_of_data+CRLFCRLF at the beginning of the output buffer and memcpy data to the output buffer

On failure outPostData and outPostDataLen will be set in 0.

Parameters
aInPostData- the post data
aInPostDataLen- the length aInPostData
aOutPostData- the buffer
aOutPostDataLen- the length of aOutPostData

◆ PostURL()

NS_IMETHOD nsIPluginHost::PostURL ( nsISupports * pluginInst,
const char * url,
PRUint32 postDataLen,
const char * postData,
PRBool isFile = PR_FALSE,
const char * target = NULL,
nsIPluginStreamListener * streamListener = NULL,
const char * altHost = NULL,
const char * referrer = NULL,
PRBool forceJSEnabled = PR_FALSE,
PRUint32 postHeadersLength = 0,
const char * postHeaders = NULL )
pure virtual

Posts to a URL with post data and/or post headers.

(Corresponds to NPN_PostURL and NPN_PostURLNotify.)

Parameters
pluginInst- the plugin making the request. If NULL, the URL is fetched in the background.
url- the URL to fetch
postDataLength- the length of postData (if non-NULL)
postData- the data to POST. NULL specifies that there is not post data
isFile- whether the postData specifies the name of a file to post instead of data. The file will be deleted afterwards.
target- the target window into which to load the URL, or NULL if the data should be returned to the plugin via streamListener.
streamListener- a stream listener to be used to return data to the plugin. May be NULL if target is not NULL.
altHost- an IP-address string that will be used instead of the host specified in the URL. This is used to prevent DNS-spoofing attacks. Can be defaulted to NULL meaning use the host in the URL.
referrer- the referring URL (may be NULL)
forceJSEnabled- forces JavaScript to be enabled for 'javascript:' URLs, even if the user currently has JavaScript disabled (usually specify PR_FALSE)
postHeadersLength- the length of postHeaders (if non-NULL)
postHeaders- the headers to POST. Must be in the form of "HeaderName: HeaderValue\r\n". Each header, including the last, must be followed by "\r\n". NULL specifies that there are no post headers
Returns
- NS_OK if this operation was successful

◆ reloadPlugins()

void nsIPluginHost::reloadPlugins ( in boolean reloadPages)

Causes the plugins directory to be searched again for new plugin libraries.

Parameters
reloadPages- indicates whether currently visible pages should also be reloaded

Field Documentation

◆ pluginCount

readonly attribute unsigned long nsIPluginHost::pluginCount

Definition at line 110 of file nsIPluginHost.idl.


The documentation for this interface was generated from the following file: