Open Finder
Select Applications
Right-click on Safari icon you’ll see there
Select Get Info
Check the “Open in 32-bit mode” item
(Re-)start Safari
Run your plug-in test page…
… the plug-in works!
I’ve now actually persuaded it to compile as 64-bit - it just needed to be using the 10.6 SDK for that. But then when it gets the window handle, which is allegedly an NSWindow*, the damn thing is null!
Ok, I’ve checked in a small update that does now compile as 64-bit and which contains code that should work, but doesn’t because safari passes a null pointer instead of any window information.
Sorry, I’m stumped. Maybe they just don’t want people to use NPAPI plugins any more?
Think how good you’ll feel when you’ve cracked it.
NB: IIRC, if you open Finder
Select Your HD
Then Library
Then Internet Plug-ins
Right-click on the Flash plug-in
Select "Show Contents"
That’ll open the window with info.plist shown
Double-click on the info.plist file
There are two items at the bottom, one called something related to Carbon, with value set to YES … is it LSPrefersCarbon?
It looks like in Safari 64-bit, plug-ins are no longer owned by a window; what we’re passed instead is a CGContextRef into which we draw when required.
i.e. the model is a bit different to what went before.
This clarifies where events come from, and how to draw, in this new system:
It sounds like the 64-bit version sandboxes plugins into a separate process, which I guess is why it doesn’t let you embed your own NSView in their GUI.
I wonder if it would be possible to create an NSView… which is hidden/floating … in response to CGContextRef paints, we render to a surface/image in the Juce NSView… and then blit out from their into the CGContextRef. Of course, we’d need to send UI events from the browser plug-in to the NSView to be handled…