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, returnNPERR_NO_ERROR
NPP_Event
: do nothing, returnkNPEventNotHandled
(0)NPP_SetValue
: do nothing, returnNPERR_NO_ERROR
NPP_GetValue
: if asked forNPPVpluginNeedsXEmbed
, 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.
精彩评论