有没有办法使用 jQuery 或 Javascript 强制在 Firefox 中打开页面?
有没有办法使用 jQuery 或 Javascript 强制在 Firefox 中打开页面?例如,如果用户将默认浏览器设置为 Internet Explorer,但他们的计算机上有 Firefox - 打开一个包含预期页面的新 Firefox 窗口。如果是这样,我需要检查他们的机器上是否有 Firefox;否则,重定向到 mozilla firefox 下载站点...
有什么建议吗?
Is there a way using jQuery or Javascript to force a page to open in Firefox? For example, if the user has their default browser set to internet explorer, but they have firefox on their computer - open a new firefox window with the intended page. If so, I would need to check to see if they have firefox on their machine; otherwise, redirect to the mozilla firefox download site...
any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
答案很简单,是否定的。出于安全原因,他们没有这样的文件系统访问权限。您可能可以想象如果您编写了一个可以打开 QuickBooks 并四处查看的程序,会发生什么情况。如果您担心兼容性,您可以使用 JavaScript 检查来通知他们您的页面需要使用 Firefox 查看,并拒绝继续,直到他们解决这个问题。
http://www.quirksmode.org/js/detect.html
或者,您知道,用老式的方法构建一个跨浏览器兼容的网页。
或者,ActiveX 或许可以做到这一点,但用户必须接受权限,这是高度可疑的活动。
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.
不。Web 浏览器不提供系统上安装的其他应用程序的信息。它会产生安全影响,例如向安装了迈克菲防病毒软件的用户显示虚假的迈克菲防病毒对话框。
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.