2

I have a plug-in that handles its own url schema (something like mystuf:// ). If a user clicks on such a link when the plug-in isn't installed (s)he gets an ugly error. So I extended my installer to write into the Registry (for Internet Explorer) and the user.js (for Firefox) to ADD a custom string to the user agent string. These additions survive a browser upgrade nicely (Microsoft uses this technique to indicate the presence of the dotNet Framework).

Now I need to extend this to Apple Safari and Google Chrome on all supported platforms.

To be clear: I'm not looking how to REPLACE the user agent string, but how to amend it with additional information.

Any hint?

4

2 回答 2

1

我遇到了类似的问题,我以与苹果对 iTunes 相同的方式实现了这一点,如此 SO question中所述。查找有关如何创建 Firefox 插件的信息更加棘手,但我的问题的答案很有帮助。所有基于 mozilla 的浏览器(Firefox、Chrome、Safari)都将使用 Firefox(或 mozilla)插件,因此您将能够使用相同的 javascript 来检测所有这些浏览器中的 firefox 插件,从而确定您的插件/安装了自定义协议/应用程序。

于 2010-07-22T17:44:52.440 回答
0

由于 Google Chrome 支持 Netscape 插件 API ( http://en.wikipedia.org/wiki/NPAPI ),因此 Firefox 方式也可能是一个很好的起点。

于 2010-07-20T07:06:08.583 回答