开发者

Show a window from 32-bit NPAPI Plugin in 64-bit Safari

开发者 https://www.devze.com 2022-12-20 19:55 出处:网络
I have an old NPAPI plugin for OS X that I\'m trying to refit for use with Snow Le开发者_JAVA百科opard\'s version of Safari. My problem is that when I switch Safari to 64-bit mode, it changes the plug

I have an old NPAPI plugin for OS X that I'm trying to refit for use with Snow Le开发者_JAVA百科opard's version of Safari. My problem is that when I switch Safari to 64-bit mode, it changes the plugin environment to out of process mode (where plugins are hosted by a 32-bit WebKitPluginHost process). And now my toolbar palettes are not visible on screen, even though the NSPanels on which they are based think they are visible. The documentation says that bringing up windows is not recommended, but doesn't say its prohibited; is there something I can do to bring up my Windows?


The most reliable solution is to simply let another application, possibly connected to your plugin via some IPC mechanism, do thatApple:

Avoid creating windows. The intent is for plug-ins to operate within the browser window. Although some plug-ins have historically done so, creating windows in your plug-in is not recommended. If you need to maintain separate windows, you should consider starting a separate application.

Bringing up windows from a plugin might work in some circumstances and completely break in different ones. By recommending against doing so Apple is at liberty to break your previously working behaviour whenever it wishes to.


Unfortunately, probably not. If you're doing anything that is not possible using the normal graphics libraries (CoreAnimation, Cocoa, etc), you probably can't do it using the 32 bit plugin in 64 bit safari.

You might be able to do more if you compile your plugin in 64 bit mode, though. I don't know :-/


I know I am a little late. Safari doesn't allow plugin to display NSPanel. You should try using NSWindow instead. I know Apple doesn't agree.

For showing menu you could use "popupcontextmenu". It takes NPNSMenu which is NSMenu typecasted.

0

精彩评论

暂无评论...
验证码 换一张
取 消