1

有没有办法使用 jQuery 或 Javascript 来强制在 Firefox 中打开页面?例如,如果用户将他们的默认浏览器设置为 Internet Explorer,但他们的计算机上安装了 firefox - 打开一个带有预期页面的新 firefox 窗口。如果是这样,我需要检查他们的机器上是否有 Firefox;否则,重定向到 Mozilla firefox 下载站点...

有什么建议么?

4

2 回答 2

8

The answer, simply, is no. They don't have file system access like that for security reasons. You can probably imagine what would happen if, say you wrote a program that could crack open QuickBooks and take a look around. If you're worried about compatibility, you can use JavaScript checks to notify them that your page needs to be viewed with Firefox and refuse continuation until they get that settled.

http://www.quirksmode.org/js/detect.html

Or, you know, do it the old fashioned way and build a web page that is cross-browser compatible.

Alternatively, ActiveX might be able to do it, but the user has to accept permissions, and this is highly shady activity.

于 2010-06-02T19:36:10.050 回答
3

No. Web browsers do not provide information on other applications installed on a system. It would have security ramifications, such as presenting a fake McAfee antivirus dialog to folks who had McAfee antivirus installed.

于 2010-06-02T19:37:01.810 回答