I need to figure out a way to install plug-ins specifically for Safari on Mac. If I copy the .plugin
files into the Internet Plug-ins
folder, it will be detected by Firefox and Google Chrome as well when they are run.
To prevent this I was using the NP_UserAgent
API call to determine the user agent, and exit if it wasn't Safari. However the plug-ins are still registered by Google Chrome and Firefox. Is there anyway to do the same thing without having either browser register the plug-in?
If you are writing an NPAPI plugin it should work in any browser. Can you explain why you are trying to prevent users running other browsers from using the plugin? Depending on the underlying need there may be a better approach. (For instance, if this is to work in conjunction with a Safari extension, all you need to do is have your extension use a MIME type that only your plugin handles, and then it doesn't matter if other browsers detect the plugin because it will never actually be instantiated).
Do you want to target only Safari, or any browser using Apple's WebKit framework? If the latter, you could write a WebKit plugin instead of an NPAPI plugin.