nsISupports
Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)nsIFile createTempFileToPost(in string aPostDataURL); Native code only! |
void createTmpFileToPost(in string aPostDataURL, out string aTmpFileName); Native code only! Obsolete since Gecko 2.0 |
void deletePluginNativeWindow(in nsPluginNativeWindowPtr aPluginNativeWindow); Native code only! |
void destroy(); Native code only! |
void findProxyForURL(in string aURL, out string aResult); Native code only! |
nsIPlugin getPlugin(in string aMimeType); Native code only! |
void getPluginCount(out unsigned long aPluginCount); Obsolete since Gecko 1.8 |
nsIPlugin getPluginFactory(in string aMimeType); Native code only! Obsolete since Gecko 1.9.2 |
void getPluginName(in nsIPluginInstance aInstance, [shared] out string aPluginName); Native code only! |
nsIPluginTag getPluginTagForInstance(in nsIPluginInstance aInstance); Native code only! |
void getPluginTags([optional] out unsigned long aPluginCount, [retval, array, size_is(aPluginCount)] out nsIPluginTag aResults); |
void handleBadPlugin(in PRLibraryPtr aLibrary, in nsIPluginInstance instance); Native code only! |
void init(); Native code only! |
void instantiateDummyJavaPlugin(in nsIPluginInstanceOwner aOwner); Native code only! |
void instantiateEmbeddedPlugin(in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner); Native code only! |
void instantiateEmbededPlugin(in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner); Obsolete since Gecko 1.8 |
void instantiateFullPagePlugin(in string aMimeType, in nsIURI aURI, in nsIPluginInstanceOwner aOwner, out nsIStreamListener aStreamListener); Native code only! |
nsIStreamListener instantiatePluginForChannel(in nsIChannel aChannel, in nsIPluginInstanceOwner aOwner); Native code only! |
void isPluginEnabledForExtension(in string aExtension, in constCharStarRef aMimeType); Native code only! |
void isPluginEnabledForType(in string aMimeType); Native code only! |
void loadPlugins(); Native code only! |
void newPluginNativeWindow(out nsPluginNativeWindowPtr aPluginNativeWindow); Native code only! |
void parsePostBufferToFixHeaders(in string aInPostData, in unsigned long aInPostDataLen, out string aOutPostData, out unsigned long aOutPostDataLen); Native code only! |
void reloadPlugins(in boolean reloadPages); |
void setIsScriptableInstance(in nsIPluginInstance aInstance, in boolean aScriptable); Native code only! Obsolete since Gecko 2.0 |
void setUpPluginInstance(in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner); Native code only! |
void stopPluginInstance(in nsIPluginInstance aInstance); Native code only! |
void UserAgent(in nativeChar resultingAgentString); Native code only! |
Attribute | Type | Description |
pluginCount |
unsigned long |
Read only. Native code only! |
To create temp file with Content len header in, it will use by http POST.
nsIFile createTempFileToPost( in string aPostDataURL );
aPostDataURL
Obsolete since Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
To create temp file with Content len header in, it will use by http POST.
void createTmpFileToPost( in string aPostDataURL, out string aTmpFileName );
aPostDataURL
aTmpFileName
Deletes plugin native window object created by NewPluginNativeWindow()
.
void deletePluginNativeWindow( in nsPluginNativeWindowPtr aPluginNativeWindow );
aPluginNativeWindow
void destroy();
None.
Fetches a URL.
(Corresponds to NPN_GetURL and NPN_GetURLNotify.)
Posts to a URL with post data and/or post headers.
(Corresponds to NPN_PostURL and NPN_PostURLNotify.)
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.
Which proxy/SOCKS to use is determined by the plugin.
void findProxyForURL( in string aURL, out string aResult );
aURL
aResult
nsIPlugin getPlugin( in string aMimeType );
aMimeType
void getPluginCount( out unsigned long aPluginCount );
aPluginCount
Obsolete since Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
nsIPlugin getPluginFactory( in string aMimeType );
aMimeType
Get the plugin name for the plugin instance.
void getPluginName( in nsIPluginInstance aInstance, [shared] out string aPluginName );
aInstance
aPluginName
Get the plugin tag associated with a given plugin instance.
nsIPluginTag getPluginTagForInstance( in nsIPluginInstance aInstance );
aInstance
Plugin tag object.
void getPluginTags(
out unsigned long aPluginCount, Optional
[retval, array, size_is(aPluginCount)] out nsIPluginTag aResults
);
aPluginCount
OptionalaResults
void handleBadPlugin( in PRLibraryPtr aLibrary, in nsIPluginInstance instance );
aLibrary
instance
void init();
None.
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
.
void instantiateDummyJavaPlugin( in nsIPluginInstanceOwner aOwner );
aOwner
void instantiateEmbeddedPlugin( in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner );
aMimeType
aURL
aOwner
void instantiateEmbededPlugin( in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner );
aMimeType
aURL
aOwner
void instantiateFullPagePlugin( in string aMimeType, in nsIURI aURI, in nsIPluginInstanceOwner aOwner, out nsIStreamListener aStreamListener );
aMimeType
aURI
aOwner
aStreamListener
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.
nsIStreamListener instantiatePluginForChannel( in nsIChannel aChannel, in nsIPluginInstanceOwner aOwner );
aChannel
aOwner
void isPluginEnabledForExtension( in string aExtension, in constCharStarRef aMimeType );
aExtension
aMimeType
void isPluginEnabledForType( in string aMimeType );
aMimeType
void loadPlugins();
None.
Creates a new plugin native window object.
void newPluginNativeWindow( out nsPluginNativeWindowPtr aPluginNativeWindow );
aPluginNativeWindow
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 '\n' 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.
void parsePostBufferToFixHeaders( in string aInPostData, in unsigned long aInPostDataLen, out string aOutPostData, out unsigned long aOutPostDataLen );
aInPostData
aInPostDataLen
aOutPostData
aOutPostDataLen
Causes the plugins directory to be searched again for new plugin libraries.
void reloadPlugins( in boolean reloadPages );
reloadPages
Obsolete since Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
To notify the plugin manager that the plugin created a script object.
void setIsScriptableInstance( in nsIPluginInstance aInstance, in boolean aScriptable );
aInstance
aScriptable
void setUpPluginInstance( in string aMimeType, in nsIURI aURL, in nsIPluginInstanceOwner aOwner );
aMimeType
aURL
aOwner
void stopPluginInstance( in nsIPluginInstance aInstance );
aInstance
void UserAgent( in nativeChar resultingAgentString );
This example here logs to Browser Console all the installed plug-ins and the associated mime types. Then using nsIHandlerService it gets the handler info. A handler is, default application that should open or deal with this file.
let pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost); let handlerService = Cc['@mozilla.org/uriloader/handler-service;1'].getService(Ci.nsIHandlerService); let mimeService = Cc['@mozilla.org/mime;1'].getService(Ci.nsIMIMEService); let pluginTags = pluginHost.getPluginTags(); for (let i = 0; i < pluginTags.length; ++i) { let pluginTag = pluginTags[i]; let mimeTypes = pluginTag.getMimeTypes(); console.warn('pluginTag:', pluginTag.name, 'mimeTypes:', mimeTypes); // go through all the mime types and get the handler service for (let j = 0; j < mimeTypes.length; ++j) { let type = mimeTypes[j]; let wrappedHandlerInfo = mimeService.getFromTypeAndExtension(type, null); console.log('handler info for type', type, wrappedHandlerInfo); } }
resultingAgentString