Closed Bug 545224 Opened 14 years ago Closed 14 years ago

When using Firefox 3.6 NPN_GetValue(NULL, NPNVserviceManager, &sm) always returns NULL

Categories

(Core Graveyard :: Plug-ins, defect)

x86_64
Linux
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: kdekorte, Unassigned)

References

Details

(Whiteboard: WONTFIX?)

I'm working on a Firefox plugin - gecko-mediaplayer. In order to play trailers at www.apple.com/trailers I need to change the user agent to QuickTime/7.6.4

Using code from the xulrunner 1.9.2 example plugin

http://mxr.mozilla.org/mozilla1.9.2/source/modules/plugin/default/windows/plugin.cpp#220

I am calling  NPN_GetValue(NULL, NPNVserviceManager, &sm)  it always returns NULL. If I run the same code without recompiling under Firefox 3.5.6 the function works properly. Recompiling against xulrunner 1.9.1 or 1.9.2 does not change this NULL return code.

I can get the service manager using NS_GetServiceManager(&sm), but that function is part of libxpcom.so and so I am unsure how long this function will be available.
If you can recommend a better way to specify the user-agent when requesting a URL rather than changing the browsers user agent, I would prefer that.
This is intentional https://developer.mozilla.org/en/NPN_GetValue

I can't help with a workaround.
Whiteboard: WONTFIX?
Then why does the example plugin use it?
(In reply to comment #3)
> Then why does the example plugin use it?

Nobody bothered to fix it would be my guess.  I'll file another bug on that.
I took a look at the xulrunner 1.9.2 npapi.h file and in there it states that NPNVservicemManager is something that can still be retrieved with NPN_GetValue, it does not have a obsolete by it. 

Also when using late binding when building a plugin, NS_GetServiceManager does not get resolved and so I get a compile error due to the -z defs LDFLAG that gives this error message

plugin.o: In function `clearPreference(CPlugin*, char const*)':
/home/kdekorte/svn/gecko-mediaplayer/src/plugin.cpp:220: undefined reference to `NS_GetServiceManager'
This is intentional, as noted. I'll be happy to review a patch which makes that more clear in the header/sample code.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WONTFIX
Component: Extension Compatibility → Plug-ins
Product: Firefox → Core
QA Contact: extension.compatibility → plugins
Version: 3.6 Branch → Trunk
(In reply to comment #4)
> (In reply to comment #3)
> > Then why does the example plugin use it?
> 
> Nobody bothered to fix it would be my guess.  I'll file another bug on that.

Filed Bug 546015.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.