My company is using Windows Edge as our default browser (so our intranet home page is loaded in Edge). Some external links in our intranet can be open/print from Chrome without any problem, however, the issue begins if the URL is open from Edge.
Can we use JavaScript to force certain links to be open on Chrome from Edge?
I tried
var shell = new ActiveXObject("WScript.Shell");
shell.run("Chrome http://...");
I got ActiveXObject is not defined.
You can't use Javascript to do that. For security reasons, Javascript is sandboxed in your browser.
See this question for more info.
There are plugins that can do that, but this would require installing them on everyone's computer.
ActiveX is not supported in Edge. So no, that won't work. And, since JavaScript alone is not allowed to access OS resources, you won't be able to accomplish this.
Related
How to open link from Chrome / Edge to IE only?
I know about security issue but my higher ups still wants to do this and its not up to me. All our website stored inside a local data warehouse in office and our website/applications doesn't show up on google. Only staff have local access to these applications
I want to open following folder using HTML or VB.NET or js
Server/Public/websiteFoldeer/Document
Google Chrome blocks this feature so my work around was to simple re-direct link to IE web browser which doesnt block this feature
<a href="file://Server/Public/websiteFoldeer/Document"/>
now for some reason above link is opening in Microsoft Edge, which does block this feature
if there is a better work around please let me know.
As you will no doubt hear, this is a very bad idea. With that said, as you discovered, the url is opening with the default web browser. If you need it to open in Internet Explorer, you'll have to call the "iexplore.exe" and pass the url as a parameter.
You will have to use something like:
<a href="javascript:exec('C:\Program Files\Internet Explorer\iexplore.exe', "file://Server/Public/websiteFoldeer/Document");"/>
Before firefox's ver 57 I was using https://github.com/edabg/jsprintsetup to change the printing configuration on the fly. This is no longer possible.
Using about:config on the browser window I can change the settings I want and when opening a new tab the changes are reflected.
My question is how do I do this after version 57? Im open to developing an extension or an add-on for firefox for this. Some of the preferences I want to change is the print.{printer}.print_orientation,print.always_print_silent etc
This is used only within the companys Intranet system, so security wont be an issue.
There is no WebExtension API for preferences manipulation.
The only way out is to implement your own experiment API, but extensions with experiment API work only on Firefox Nightly and Developer Edition.
I'm working on a new project and I need to open a link in Explorer with a click on button from Chrome or Firefox using any browser language.
I have search a lot and I found this code
I tried this i-explorer:https://www.google.com
<a class="mscom-link c-call-to-action c-glyph edgedownload" aria-label="Try Microsoft Edge" href="Microsoft-edge:https://microsoftedgewelcome.microsoft.com/?FORM=MK12CD&wt.mc_id=MK12CD" data-bi-name="try now" data-bi-id="n1c1m1r1a3" data-bi-type="text" data-bi-bhvr="TRIALSINITATE"><span class="x-hidden-focus">TRY NOW</span></a>
This code open the link in microsoft edge but I want to open it on internet explorer I've taken this code from this https://www.microsoft.com/en-gb/windows/microsoft-edge.
You can try to open microsoft edge.
Please don't tell me to use extensions I know that.
I think it's possible to do that. Thanks alot.
The only way to do it without a plugin would be to add a protocol handler to the registry on your machine. Edge does it out of the box because it contains one - just like any other application that is capable of opening links to specific applications, (Skype and Steam for example).
Obviously adding it onto your machine won't distribute onto other machines and this cannot be achieved from a web page.
For example:
Skypes protocol handler would be:
Skype
Sadly, IE does not have one.
If you want to view the protocols - you'll find them in RegEdit- under HKEY_CLASSES_ROOT. For example the edge one will be under microsoft-edge folder, and you want to open the String option titled "URL Protocol". You'll find all available protocols on your system inside the key mentioned above.
While there isn't an existing protocol handler for IE, you can easily create one:
https://learn.microsoft.com/en-us/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa767914(v=vs.85)
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.
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.
It sounds like you want to have a link in an email that activates a specific program 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).
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.)
Side note: Obviously, though, barring it being impossible I'd recommend making your application compatible with Chrome and Firefox.
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/hehijbfgiekmjfkfjpbkbammjbdenadd
Use 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
You don't have to write code to create a custom protocol handler in Windows. See this page for how to define one in the registry.
You can use User agent switcher for chrome or firefox
For Chrome :
https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg
For Firefox :
https://addons.mozilla.org/en-US/firefox/addon/uaswitcher/
We are using Google Apps at our company and everyone has Chrome installed on their computers. The problem is that we still have to use IE for certain things. I have a few html files on our intranet site that link to Google Docs, but it's opening in an IE browser. I need it to open a Chrome browser so the user doesn't have to sign in each time they open the file. I only have control of the html files settings so is there any way to use Javascript to force a window to open in Chrome?
Thanks!
I believe that if you're using IE you can use ActiveX to open up specific programs.
For instance try looking at 'new ActiveXObject'
You must explicitly allow this however as IE confirms if you want to allow it to be executed.
function loadProg(path){
var active = new ActiveXObject("WScript.Shell");
activeX = active.Run(path);
}
If you know the direct file path use this like
loadProg(path);
More specifically like
window.onload = function(){
loadProg("\"C:\\Program Files (x86)\\Guitar Pro 5\\GP5.exe\"");
};
I don't know the path to Chrome so i used something else instead.
Check if current browser is chrome:
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
if not, alert user to show a message.
Are you asking if you can open a Chrome window from Javascript in an IE window? If so, then no, this is not possible. Javascript code in browsers run within a very strict sandbox that would not permit you to make any system calls. Opening a Chrome window from IE would effectively require you to execute chrome.exe on the client's machine. I'm sure you can see how this ability, if granted, could be misused to execute malicious exe's on the client' system.
I am quite sure that the best you can do using JavaScript is show a message to the user and tell them to open the file in Chrome instead. JavaScript does not have the right to execute an external application such as Chrome. See http://www.w3schools.com/js/js_browser.asp for information about detecting the browser using JavaScript.