开发者

NPAPI: preferred windowing model (windowed/windowless/xembed) for non-visual plugin

I'm creating an NPAPI plugin that isn't supposed to have a UI (for use from Javascript only). What windowing model should I use (windowed/windowless/xembed) to support as many browsers (and browser versions) as possible?

I currently implement the following functions:

  • NPP_SetWindow: do nothing, return NPERR_NO_ERROR
  • NPP_Event: do nothing, return kNPEventNotHandled (0)
  • NPP_SetValue: do nothing, return NPERR_NO_ERROR
  • NPP_GetValue: if asked for NPPVpluginNeedsXEmbed, answer yes if the browser supports it (NPNVSupportsXEmbedBool), no otherwise

For this plugin I am supporting Linux & Windows only for now. The NPPVpluginNeedsXEmbed was necessary for Chrome on Linux (开发者_StackOverflow中文版bug 38229), however some old versions may not support it as the MDC page says that the sample plugin for XEmbed is only supported on Firefox 2.0+.


The most common that I have seen is to not care at all about the windowing mode and set the object tag to 1x1 (you can try 0x0, but I've seen browser bugs related to that) size, in which case it doesn't really matter what window mode you use. However, I would do windowless myself since it won't ever cause the trademark block that floats over all other DOM elements that a normal windowed (XEmbed or not) plugin gives you.

This is what FireBreath does if the FB_GUI_DISABLED flag is set.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜