(SOLVED) Hello World Browser plug-in fails


Read entire thread for solution...


I have tried to build a simple hello world browser plug-in.  For some reason FireFox doesn't see it.  But it doesn't have any issues with the demo browser plug-in.  Here are the steps i followed to create the hello world plug-in.

  1. Run introjucer (built using VS2012), create a new DLL project.
  2. Rename the juce-master folder to juce-master-REMOVE (I do this make sure VS doesn't attempt to read/build from the origianl source folders)
  3. open VS2010 project with VS2012, do not update to 2012 libraries when asked.
  4. copy BrowserPluginCharacteristics.h from demo plug-in and edit (See attached edited copy)
  5. create npHelloWorld.cpp (attached)
  6. copy juce-master...../modules/juce_browser_plugin_client folder to <project>...\JuceLibraryCode
  7. Add juce_browser_plugin.cpp to 'Juce Library Code' folder in project
  8. Add --#include "modules/juce_browser_plugin_client/juce_browser_plugin.h"-- to JuceHeader.h (after juce_video.h)
  9. Add --#include "BrowserPluginCharacteristics.h"-- to AppConfig.h (in the user editable section)
  10. Add $(ProjectDir)..\..\Source in 'additional include dirs' in the project settings
  11. Clean/rebuild on release
  12. create testplugin.html (attached)
  13. copy dll to %appdata%\mozilla\plugins folder

When I start FF, and browse to about:plugins, I see the juce demo plugin, but not mine.  If I open the testplugin.html file the javascript console (F12) shows that it fails to locate/load the plug-in.  I assume my issue is with the build and/or installation process.  I followed the same install process (copy the dll to ...\plugins folder), so I have to think the build is different.  

I noticed that when I build the demo plugin I get a couple of linker warnings about some interfaces should be made private.  But I get the same warnings in my build.  The big difference between the two build processes, is that with my build, I get a bunch of warnings from ...wrapper/juce_npapi_gluecode.cpp and ...wrapper/juce_activex_gluecode.cpp.

Any ideas what I might be doing wrong?

attached is the build log with the warnings in it. i doubt this is the issue, but i don't understand why i don't see the same warnings when building the juce demo plugin?


I made a whole new hello world plug-in.  This time I did not do Step #2 or #3 (I upgraded 2012 libraries) as listed above.  It still fails to load.

Also, the extra warnings in my project that do not appear in the juce demo browser plug-in are a red herring.  The demo project's warning level is "3" whereas the introjucer created project's warning level is '4'.  If I change the demo project to '4' I get the same batch of warnings.

Running depends.exe on both dlls shows that they both export the same 8 entry points.  And a visual comparison of dependant dlls appears to be identical.  One thing I find a bit odd is that the juce demo plug-in is ~1.4MB but my hello world plug-in is ~2.7MB.  However, that is most likely due to the fact that the juce demo plug-in's project was not built using Introjucer defaults?

At this point I'm at a complete lost as to why one plug-in loads but the other does not.

Any ideas?

The difference is the resoucre file.  The working juce demo plug-in has a .rc file that exports (amoung other things) the MIMEType.  The default 'resource.rc' does NOT.

Here's what I did to fix this...

  1. removed the resources.rc that comes with the introjucer built project
  2. added juce_NPAPI_WinResource.rc to the project
  3. updated resouce compiler's include path such that it includes $(ProjectDir)..\..\Source.  This allows the rc compiler to locate the BrowserPluginCharacteristics.h file

It seems like I had to restart FF twice, but eventually FF's about:plugins page listed my hello world plug-in.  And my test html page was able to load it correctly.


Thanks for listening...