Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NPN_GetValue() no longer support NPNVDOMWindow in Firefox 3.6a1

18 views
Skip to first unread message

quaful

unread,
Aug 12, 2009, 1:22:58 AM8/12/09
to
I'm a Firefox plugin developer and recently I have noticed that my
plugin stopped working in Firefox 3.6a1. After I traced into the code,
I found that is caused by the modifications in Firefox 3.6a1:

When my code calling:
<pre>NPN_GetValue( npp,NPNVDOMWindow, NS_STATIC_CAST(nsIDOMWindow **,
&m_domWindow)
</pre>NPN_GetValue() CAN NOT get the DOM window in the plugin. Return
code
is NS_ERROR_GENERIC.

Digging into the source code of Firefox 3.6a1 shows that:

NPError NP_CALLBACK
_getvalue(NPP npp, NPNVariable variable, void *result)
{
...
// we no longer hand out any XPCOM objects, except on WINCE,
// where it's needed for the ActiveX shunt that makes Flash
// work until we get an NPAPI plugin there.

#ifdef WINCE

caseNPNVDOMWindow: {
...

}

The above is the source code of Firefox 3.6a1. The coder has already
commented thatNPNVDOMWindowis no longer supported except in WinCE.
Unfortunately, my plugin is for Windows XP, Vista and Win7.

I don't understand why "no longer hand out any XPCOM objects". Many
plugins are using that way, including Google Gears.

And, if I want to get nsIDOMWindow object in my plugin, how can I do
that? Is there any alternative way?

taxilian

unread,
Aug 18, 2009, 1:47:42 PM8/18/09
to

The reasoning behind all of this, as I understand it (someone feel
free to chime in with additional info) is that XPCOM will no longer be
supported as of Firefox 3.6. It has been replaced with npruntime.
For a more complete discussion on the history, see
http://en.wikipedia.org/wiki/Netscape_Plugin_Application_Programming_Interface

For more information from the mozilla docs, see:
https://developer.mozilla.org/en/Gecko_Plugin_API_Reference:Scripting_plugins

I have written a blog post about npruntime which might or might not be
useful to you, and you can find it here:
http://colonelpanic.net/2009/08/building-a-firefox-plugin-%E2%80%93-part-three/

I have done a quick search on my computer, which has google gears
installed on it, and I can find only two google plugins installed;
google update and google talk. I'm not certain if gears is stored in
one of those or if I'm missing something, but both of those google
plugins use npruntime (as can be seen by the lack of a .xpt file)
This makes sense particularly since XPCOM isn't supported on any
browser but firefox, whereas plugins developed with npruntime can work
with Safari, Google Chrome, Opera, Firefox, and pretty much any recent
gecko-based or webkit-based browser.

Hope that helps,

Richard Bateman

quaful

unread,
Aug 22, 2009, 9:57:10 AM8/22/09
to
> For a more complete discussion on the history, seehttp://en.wikipedia.org/wiki/Netscape_Plugin_Application_Programming_...
>
> For more information from the mozilla docs, see:https://developer.mozilla.org/en/Gecko_Plugin_API_Reference:Scripting...

>
> I have written a blog post about npruntime which might or might not be
> useful to you, and you can find it here:http://colonelpanic.net/2009/08/building-a-firefox-plugin-%E2%80%93-p...

>
> I have done a quick search on my computer, which has google gears
> installed on it, and I can find only two google plugins installed;
> google update and google talk.  I'm not certain if gears is stored in
> one of those or if I'm missing something, but both of those google
> plugins use npruntime (as can be seen by the lack of a .xpt file)
> This makes sense particularly since XPCOM isn't supported on any
> browser but firefox, whereas plugins developed with npruntime can work
> with Safari, Google Chrome, Opera, Firefox, and pretty much any recent
> gecko-based or webkit-based browser.
>
> Hope that helps,
>
> Richard Bateman

Indeed, npruntime can work with Safari, Google Chrome and many other
browsers, and I think this is a reason strong enough for me to change
my code to npruntime. Thank you.

0 new messages