Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Browser Side Plug-in API

这篇文章需要技术复核。如何帮忙。

This chapter describes methods in the plug-in API that are available from the browser. The names of all of these methods begin with NPN_ to indicate that they are implemented by the browser and called by the plug-in. For an overview of how these two sides of the plug-in API interact, see the How Plug-ins Work and Overview of Plug-in Structure sections in the introduction.

本文描述了浏览器可用的插件API方法。所有的方法均已NPN_开头,用以表明它们由浏览器执行且由插件调用。了解更多浏览器和插件交互,查看How Plug-ins WorkOverview of Plug-in Structure

警告: 你仅能够在主线程中调用这些函数;在其他线程调用不仅不被支持同时还会产生无法预测的结果。

SummaryNetscape插件方法

NPN_DestroyStream
关闭并删除一个流。
NPN_ForceRedraw
为一个无窗口插件强制绘制消息。
NPN_GetAuthenticationInfo
这个函数用于为插件获取浏览器的HTTP authentication 信息。
NPN_GetURL
请求浏览器为指定的URL创建一个流。
NPN_GetURLNotify
请求使用特定URL内容创建一个新的流;同时获取创建结果的通知。
NPN_GetValue
允许插件询问浏览器信息。
NPN_GetValueForURL
为插件提供URL附带的信息,比如cookies和首选代理。
NPN_InvalidateRect
Invalidates specified drawing area prior to repainting or refreshing a windowless plug-in.
NPN_InvalidateRegion
在更新或者重绘一个无窗口插件之前使得指定的绘画区域无效。
NPN_MemAlloc
从浏览器内存区域中分配内存。
NPN_MemFlush
请求浏览器释放特定的内存区域。
NPN_MemFree
重新分配已经分派的内存。
NPN_NewStream
Requests the creation of a new data stream produced by the plug-in and consumed by the browser.
NPN_PluginThreadAsyncCall
Thread-safe way to request that the browser calls a plug-in function on the browser or plug-in thread (the thread on which the plug-in was initiated).
NPN_PopPopupsEnabledState
Pops the popups-enabled state.
NPN_PostURL
Posts data to a URL.
NPN_PostURLNotify
Posts data to a URL, and receives notification of the result.
NPN_PushPopupsEnabledState
Pushes the popups-enabled state.
NPN_ReloadPlugins
Reloads all plug-ins in the Plugins directory.
NPN_RequestRead
Requests a range of bytes for a seekable stream.
NPN_SetValue
Sets windowless plug-in as transparent or opaque.
NPN_SetValueForURL
Allows a plug-in to change the stored information associated with a URL, in particular its cookies.
NPN_Status
Displays a message on the status line of the browser window.
NPN_UserAgent
Returns the browser's user agent field.
NPN_Version
Returns version information for the Plug-in API.
NPN_Write
Pushes data into a stream produced by the plug-in and consumed by the browser.

文档标签和贡献者

 此页面的贡献者: teoli, Magaret
 最后编辑者: teoli,