Javascript 在 Firefox/Chrome 页面中打开 IE 浏览器
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10070744/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Open IE browser in Firefox/Chrome page
提问by Mike Huang
Our Web application is based on IE9, which means only IE9 can open the pages in our site. We'll prevent user to browse our site when their browser is not IE9. But sometimes we had to send a link to user's email box to complete some actions and they will open the link directly with their default browser, the problem is here, if the default browser is not IE9 then they can't open the link, they have to copy the link to IE9. Our user don't want do this manually, they want open the link in IE9 directly no matter what the default browser is.
我们的 Web 应用程序是基于 IE9 的,这意味着只有 IE9 才能打开我们站点中的页面。当用户的浏览器不是 IE9 时,我们将阻止用户浏览我们的网站。但是有时候我们不得不发送一个链接到用户的邮箱来完成一些操作,他们会直接用他们的默认浏览器打开链接,问题就在这里,如果默认浏览器不是IE9,那么他们无法打开链接,他们必须将链接复制到 IE9。我们的用户不想手动执行此操作,无论默认浏览器是什么,他们都希望直接在 IE9 中打开链接。
I have tried using ActiveXObject, but it only works in IE. I want have a script which can open IE browser in Firefox/Chrome page.
我曾尝试使用 ActiveXObject,但它仅适用于 IE。我想要一个可以在 Firefox/Chrome 页面中打开 IE 浏览器的脚本。
回答by T.J. Crowder
It sounds like you want to have a link in an email that activates a specificprogram on the user's computer rather than the program that they've identified should be used (e.g., their default browser). I don't believe you can do that.
听起来您希望在电子邮件中包含一个链接来激活用户计算机上的特定程序,而不是他们认为应该使用的程序(例如,他们的默认浏览器)。我不相信你能做到。
You can install "protocol handlers" in both Chrome and Safari (I suspect Firefox as well), which would let you send a link like ie://example.com/path/to/app
. Your protocol handler would launch IE and take you to the relevant site. (Apple does this with iTunes.) But your users would have to install the handler (and, of course, you'd have to write it).
您可以在 Chrome 和 Safari(我怀疑 Firefox 也是如此)中安装“协议处理程序”,这样您就可以发送类似ie://example.com/path/to/app
. 您的协议处理程序将启动 IE 并将您带到相关站点。(Apple 用 iTunes 做到了这一点。)但是您的用户必须安装处理程序(当然,您还必须编写它)。
An easier answer might be to have the users install any of the ubiquitous "open in IE" add-ons/extensions that exist for Chrome, Firefox, etc. They follow the link, then choose "open in IE" from some kind of menu. (If they're using webmail, they may even be able to right-click the link and choose that line item, depending on the extension.)
一个更简单的答案可能是让用户安装 Chrome、Firefox 等存在的任何无处不在的“在 IE 中打开”附加组件/扩展。他们点击链接,然后从某种菜单中选择“在 IE 中打开” . (如果他们使用网络邮件,他们甚至可以右键单击链接并选择该行项目,具体取决于扩展名。)
Side note: Obviously, though, barring it being impossible I'd recommend making your application compatible with Chrome and Firefox.
旁注:显然,除非不可能,否则我建议您的应用程序与 Chrome 和 Firefox 兼容。
回答by Dor Cohen
No you can't do it..
不,你不能这样做..
but there is some alternatives:
但有一些替代方案:
Install your users IE tab:
FireFox - http://lifehacker.com/135297/internet-explorer-in-a-firefox-tab?tag=softwarewebpublishing,
Chrome - https://chrome.google.com/webstore/detail/hehijbfgiekmjfkfjpbkbammjbdenaddUse a batch file that will launch your link in explorer.
use this Firefox plugin makes it possible to use (host) ActiveX controls in Firefox - http://code.google.com/p/ff-activex-host/
instead of ActiveX try using Netscape Plugin Application Programming Interface (NPAPI)- a cross-platform plugin architecture used by many web browsers.
Similar as with a batch file, you may create a link file to the page you need using the ".website" file extension with IE, which is configured in windows by default to open with ie. Put it in your webserver public folder and then add a link to that file in your website
安装您的用户 IE 选项卡:
FireFox - http://lifehacker.com/135297/internet-explorer-in-a-firefox-tab?tag=softwarewebpublishing,
Chrome - https://chrome.google.com/webstore/detail/ hehijbfgiekmjfkfjpbkbammjbdenadd使用将在资源管理器中启动链接的批处理文件。
使用这个 Firefox 插件可以在 Firefox 中使用(主机)ActiveX 控件 - http://code.google.com/p/ff-activex-host/
尝试使用Netscape 插件应用程序编程接口 (NPAPI)代替 ActiveX - 许多 Web 浏览器使用的跨平台插件架构。
与批处理文件类似,您可以在 IE 中使用“.website”文件扩展名创建指向所需页面的链接文件,该文件在 Windows 中默认配置为使用 ie 打开。将它放在您的网络服务器公共文件夹中,然后在您的网站中添加指向该文件的链接
回答by Kent
回答by Mohammed Elgamal
You can use User agent switcher for chrome or firefox For Chrome : https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg
您可以使用 Chrome 的用户代理切换器或 Chrome 的 firefox :https: //chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg
For Firefox : https://addons.mozilla.org/en-US/firefox/addon/uaswitcher/
对于 Firefox:https: //addons.mozilla.org/en-US/firefox/addon/uaswitcher/