XEmbed-aware NPAPI Plugins?

Maksim Orlovich mo85 at cornell.edu
Wed Apr 4 15:52:26 BST 2007


>> Not a new version of NPAPI.

Coincidentally, I had WIP versions with partial support of npruntime, but
they're rather useless since they make flash crash badly.. I'll probably
try again in KDE4 where I can implement everything, not just a subset of
functionality.

>>
>> Mozilla implements XEmbed for embedding plugins on X, which differs (in
>> good ways) from the classical Xt mainloop method (though it still
>> supports the old method). The API (from the plugin's perspective) is
>> here:
>>
>>    http://www.mozilla.org/projects/plugins/xembed-plugin-extension.html
>
> I see, thanks for clarifying.
>
> I think we already use XEmbed or something similar for plugins because we
> run
> them out of process as part of nspluginviewer, in which case it might not
> be
> very difficult to check if the plugin can do its side of XEmbed itself.

It would be very difficult. nspluginviewer has non-trivial communication
with the browser. When it comes to embedding the plugin inside
nspluginviewer, well... I can't speak for George, of course, but when I
looked at the spec and the examples before, I frankly found it very
problematic (and not much of a spec), and wasn't sure that implementing it
won't break tons of plugins... Besides the XEmbed flag, the ABI revision
also comes with a "tookit flag", which has only 2 specified values: Gtk
1.2 and Gtk 2.0. And, well, the examples they have encourage plugin
authors to check that:
    err = CallNPN_GetValueProc(gNetscapeFuncs.getvalue, NULL,
                               NPNVSupportsXEmbedBool,
                               (void *)&supportsXEmbed);

    if (err != NPERR_NO_ERROR || supportsXEmbed != PR_TRUE)
        return NPERR_INCOMPATIBLE_VERSION_ERROR;

    err = CallNPN_GetValueProc(gNetscapeFuncs.getvalue, NULL,
                               NPNVToolkit,
                               (void *)&toolkit);

    if (err != NPERR_NO_ERROR || toolkit != NPNVGtk2)
        return NPERR_INCOMPATIBLE_VERSION_ERROR;

And, frankly, I am not sure I'm confident that lying here will be safe.
(Coincidentally, depending on which ABI version this is at, we might have
to provide fake versions of some gtk symbols to make Flash 7 not crash)

>
> However, you better wait for an answer of the developers with in-depth
> knowlegde of browser and/or plugin handling (please excuse the CC'ing
> guys)

Good job CCing the wrong people :p

-Maks






More information about the kfm-devel mailing list