Mac firefox plugin directory structure and configuration?

Hi everyone,

I am now able to successfully build the mac demo browser plugin and try it on my firefox. My own product was an Active/X plugin on windows and I have now ported it to Mac. I’ve been able to build it using xcode that I started from scratch and sort of morphed my visual studio file into it. Now I’ve to figure out how to run it in firefox.

I used the same MIME type as the demo and I think I copied info in Info.plist right. Mine is a dylib instead of a bundle. Is that why it isn’t working?

Is there a tutorial somewhere on the web that I could use if I didn’t originally start out with the browser plugin demo xproj?

Yes, it has to be a bundle - there are lots of things like that that you have to get right for the browser to recognise it correctly.

I change my tactics to start with the demo version of xcode project and insert my source files in. When I turn on the test file in firefox with firebug, there’s no response to the buttons in the test page (firebug doesn’t show anything as we would step into printMessage for example.

On Windows I was able to attach VC++ to IE to see what was up. What’s the best way to test what’s going on here? I see the plugin listed under about:plugins and now I’m using the same MIME type and everything as the browser plugin.

My code does work for firefox on Windows …

What tools did you use to test this Jules?

I’ve never tried firebug, I was just running it in the VC debugger by setting up iexplore.exe or firefox.exe as the debug target. Strange about the buttons not working, I’ll have to see if I can recreate that.

The firefox plugin for Windows is an npXXX.dll while the one for mac appears to be an executable. How does that work? I couldn’t find a ‘main’ function in the juce browser plugin demo code!

Also, can some kind soul with Mac app dev experience write a tutorial on how I could connect to a plugin through the browser using xcode or something, that would be terrific! I am going to play around with gdb for now to see if that works!

It should be a bundle rather than an executable (though an executable is a kind of bundle). And of course you don’t get a main() function, it’s a plugin, not an app!

You can debug it if you add a custom executable to your xcode project, where the executable is your browser. That’ll let you launch the browser in the debugger. I had some problems getting this to work with firefox, but safari works ok.

Hi Jules,

I’ve built the JuceBrowserPluginDemo.xcodeproj project for Mac, using Juce 1.5 from the git tip.

The test page displays OK for both Firefox and Safari… but the scripting doesn’t work for Firefox!!

Any ideas…?

Best wishes,


I’ve been using scripting in firefox with no probs… hmm, maybe your cunning html object tag hack means that the JS isn’t finding the correct plugin object?

You might be right. :slight_smile: I’m not near my Mac until this evening - any chance you could give it a quick try?

So to summarise:

  • the Mac version displays fine under Safari, but scripting doesn’t work. :slight_smile:
  • the Windows version doesn’t display under Safari until you resize the Safari window (but scripting works).

Now here is a weird thing: if you resize the Safari window slowly and vertically then the plug-in doesn’t display. If you resize it rapidly vertically (or at any speed horizontally), then it displays immediately. Go figure. :slight_smile:

I really hate the way that every browser works differently. Very similar to the problems in getting VSTi implementations working with all the different DAWs!