NPRuntime plugin says Missing Plug-in in Safari(Windows) - safari

I have developed an NPRuntime plugin, everything is ok, but it not initialized in Safari. I registered the plugin in MozillaPlugins registry key, it works fine for Chrome/FF/Opera, but Safari writes the the plugin is missing, although I found my plugin in the list of isntalled safari plugins. What am i doing wrong ?

That's real hard to say. Safari on windows isn't supported real well by Apple, so I don't bother supporting it much myself. If it's really important I'd recommend adding logging in all your NPP_ methods (and your NP_ functions too) and see what is getting called; find out if it even loads your plugin. Often if something doesn't go as the browser wants during startup it will act like it didn't find it at all.
You could also use Process Monitor to see if it is trying to load the file or not.

Related

Play framework unload jars at runtime

I am trying to manage my dependencies of my play framework application. I am trying to remove/update some jar that exists in my classpath. Does that even possible?
It would be great to get an explanation of how does play framework manages classloaders. I understood that in order to obtain hot redeployment of code in development mode Play is restarting the application classloader and loads all classes again. Does it right?
Thanks a lot!
It's not really Play managing the hot reloading but rather the Play SBT plugin.
A Play application's main method is in play.core.server.NettyServer. The method receives a reloader of type SBTLink and each time a request hits the server, the application delegates the task of checking if there have been any code changes to the reloader.
If there has been a code change then the existing classloader is removed and replaced with a new one which includes the updated bytecode. The application is restarted but, of course, the JVM is not.
Play is not designed to provision dynamic swapping of Jars at runtime. For this, you would need to look at things like OSGi (which I would not personally recommend after a few years of working with it).

Programmatically install extensions on Safari 8 OSX 10.10

I'm trying to fix a couple of bugs for SafariDriver/Selenium.
Here is the problem:
On Safari 7 and bellow, to install a new plug in all you had to do is put the extension into ~/Library/Safari/Extensions. Next all you have to do is activate the plugin by adding it to the ~/Library/Safari/Extensions/Extensions.plist after this the Safari will have the plugin installed.
Starting with 10.10, this is no longer possible to do. The location of the extension is the same but i'm not sure how to activate the extension, since the Extensions.plist no longer exists.
My understanding is that there is some file that is controlled via "Safari Extensions List" password in the keychain under login but I have no idea which file this may apply to.
If I compile and install the extention by hand, everything works just fine but the automatic installation of the latest plugin is broken. (documentation for this https://code.google.com/p/selenium/wiki/SafariDriverInternals)
"Safari Extensions List" password is not password actually but a binary plist same as ~/Library/Safari/Extensions/Extensions.plist
Read it, modify it, write it back.
The correct thing to do is to have the user install the extension by opening it manually (double-click or command o). That's what Apple is trying to get you to do.
Apple never really wanted anybody messing about with plists for other apps.
Most preferences plists are cached in memory anyway and would require a new login session to blow them away and get new copies.
plists are updated on ending the session or the app in question.
They were never intended as a means to modify another app's behavior. That is a security risk.
In the case of Selenium, the intent is clearly to create an automated test environment. Setting up a nice installer pre-empts that to some degree.
The right thing to do is to file a bug with Apple letting them know what kind of functionality you need in Safari.

Updating extensions in a XULRunner application

Is it possible for extensions in XUL application to auto update to newer version when app starts? I'm trying to figure this out. If this is possible I would be very grateful if someone would point me to good documentation about this, because I can't find any good articles about this subject on the Internet.
XULRunner has the same extension update mechanism built in as Firefox - it will look for extension updates once daily when the application is running. If it finds an update then it will update restartless extensions immediately, other extensions are downloaded and updated on next application start. You have to make sure that the following preferences are defined for your application (copied from Firefox preferences):
pref("extensions.update.autoUpdateDefault", true);
pref("extensions.update.enabled", true);
pref("extensions.update.interval", 86400);
pref("extensions.update.url", "...");
pref("extensions.update.background.url", "...");
The tricky part are the update URLs. Of course you can use the same URLs as Firefox:
https://versioncheck.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
https://versioncheck-bg.addons.mozilla.org/update/VersionCheck.php?reqVersion=%REQ_VERSION%&id=%ITEM_ID%&version=%ITEM_VERSION%&maxAppVersion=%ITEM_MAXAPPVERSION%&status=%ITEM_STATUS%&appID=%APP_ID%&appVersion=%APP_VERSION%&appOS=%APP_OS%&appABI=%APP_ABI%&locale=%APP_LOCALE%&currentAppVersion=%CURRENT_APP_VERSION%&updateType=%UPDATE_TYPE%&compatMode=%COMPATIBILITY_MODE%
This will work fine for extensions available on addons.mozilla.org. However, I suspect that the extensions for your application will not be available there. Then you have two options. You can enter some dummy URL here like data:text/xml,<nada/> to keep the add-on manager quiet and make sure that all extensions have a custom updateURL. Or you can run your own update server that will produce update manifests for all known extensions (basically what addons.mozilla.org is doing).

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

I have an old NPAPI plugin for OS X that I'm trying to refit for use with Snow Leopard'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.

What is a xul runner?

The reason I ask is because every e-mail that I get with a link attached I keep getting " Platform Version 1.9.0.4 not compatible with min version>=1.9.0.5 max version<=1.9.0.5.
I don't have a clue how to get rid of xul runner or what I need to do in order for my computer to accept xul or whatever I need to do. Can someone please provide me with step by step (and I mean very explicit step by step) directions on how to do whatever it is I need to do to get this fixed?
XUL is a tool created by Mozilla Corporation (the folks that made Firefox and Thunderbird) to make writing their applications more like writing applications for the web.
With that said, if you're using Firefox to view webmail when you're having this issue or using Thunderbird and having this issue, I would uninstall any plugins you have installed and check it then. If that still doesn't resolve the problem, try uninstalling and reinstalling the application you're using to view the message in.
While this is the wrong place for this question, you could try asking in mozilla support:
http://support.mozilla.com/en-US/kb/Ask+a+question