How to change browser from IE to Chrome on Hyperlink click [duplicate] - html

This question already has answers here:
Can I force a link to open in a specific browser?
(6 answers)
How can I open a link in the default web browser from an HTA?
(2 answers)
Closed 2 years ago.
I have one application which default open in IE browser. On the home page, there is link. if we click that link, application open in another tab of IE but I want to change the browser also.
<!DOCTYPE html>
<html>
<body>
<p>Open link in a chrome browser Visit Dotnet Tutorial</p>
</body>
</html>
If I click on Visit Dotnet Tutorial, it should open in chrome. How to setup browser also in Hyperlink.
Please help on this.
thanks

Place this code in between head tag.
<script type="text/javascript">
function openURL()
{
var shell = new ActiveXObject("WScript.Shell");
shell.run("Chrome https://google.com");
}
</script>
and use anchor tag like this.
<a href="#" title="your wish" onclick="openURL()">
Based on an answer to How can I open a link in the default web browser from an HTA? by Johnny Buchanon - Oct 9 2008.

This is not possible from the HTML.
Browser is chosen based on the Operating System settings.
Yours is obviously IE.
If you own the dotnet-tutorial page, you can set up a browser check there
and add a notification like:
"This page works best in Google Chrome"
This question explains how to detect browser:
How to detect Safari, Chrome, IE, Firefox and Opera browser?

Extension to Ajay's answers if ActiveX - Automation Server Can't Create Object and link doesnot open in chrome
please follow this steps:
a) Go to Tools-->Internet Options
b) Select security tab
c) Click on Trusted Sites (or Local Intranet depending on whether your site is trusted or not)
d) Click on Custom Level
e) Ensure that "Initialize and script active x controls is not marked safe for scripting" is enabled - this comes under Activex controls and plug-ins section towards 1/4th of the scroll bar.
Click OK, OK.
Once this is completed, clear the browser cookies and cache. Close all your browser sessions. Reopen the IE to launch your site.

Related

How to Automatically redirect website IE browser to Chrome browser?

Recently we migrated to latest version of application which allows the user to open application in any browser.
Earlier it use to support Only IE browsers.
After migration many users still open the application in old browser.
Since the application is very slow in IE browser.We are looking for a solution that will automatically open the URL/Login Page in Chrome browser when user opens in IE browser.
i.e., when a user open URL in IE browser it automatically open the same URL in Google chrome browser.
Google Chrome Legacy Browser support allows this. Under the "Hosts to open in Alternative Browser" policy, put in an entry for the site you want to force to open in Chrome, preceding it with an "!". Example:
!https://www.somesitetoopeninChromeonly.com.
If i understand it correctly, the users open a page in IE and when they click an url on that page, it will open that URL in Chrome.
I guess, you can't do this. You can use target="_blank" to open a new tab in the same browser.
If you want to open a link from an application in chrome and not in IE, you can change the default browser to chrome. Click on Start, type the "default app settings" and change the default browser to chrome.
I think the best solution is to let the user open Google Chrome manually by informing about it.
It is possible however, to make a document called "chrome.hta" for example, with the contents shown below, and then link to it on another page. (This will only work in Internet Explorer, not Edge)
<script type="text/javascript" language="javascript">
var oShell = new ActiveXObject("Shell.Application");
var commandtoRun = "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe";
var website = "http://example.com/";
oShell.ShellExecute(commandtoRun, website, "", "open", "1");
window.close();
</script>
The user now has to press "open" and "allow" after they click the link referring to the .hta file.
Now, on the page where you link to the .hta document, you can make the page detect the browser and adjust the link accordingly:
<a id="link" href="example.com">My Application</a>
<script>
if (navigator.appName == 'Microsoft Internet Explorer' || !!(navigator.userAgent.match(/Trident/) || navigator.userAgent.match(/rv:11/)) || (typeof $.browser !== "undefined" && $.browser.msie == 1))
document.getElementById("link").href = "example.com/chrome.hta";
</script>
A bit late, but we have two different solutions for this:
We use a javascript: link to use ShellExecute to run a small exe helper application that checks if Chrome is installed, and if it is, open Chrome to the URL parameter, optionally with switches (e.g. --use-system-default-printer and on shared logon PCs, --incognito). This requires configuring special permissions for the site in Internet Options|Security.
Now we can also use the microsoft-edge: protocol to open sites in Edge.
You could also install your own protocol for opening sites in Chrome but you would need a helper application to re-write the URL. I have one written to add microsoft-edge-private: to open links in Edge in InPrivate mode.
To open the webpage in Microsoft Edge you can try the below code.
TEST

opening microsoft edge or chrome or (another browser (cascading)) on hyperlink [duplicate]

This question already has answers here:
Open IE browser in Firefox/Chrome page
(4 answers)
Closed last year.
Register
Above is my current a href tag.
Here's what I want to do:
For example I'm currently on google chrome, I want the link above be opened first on Microsoft edge, and the user doesn't have it, it would open internet explorer, if not google chrome, if not opera... etc.
ALSO. When I open the link, it also opens on the browser I'm using. How do I make it 'not' open on my current browser and only on the new one?
Thanks in advance. I'm using this on a patcher for a game I'm making, in-case you're wondering.
Its actually impossible to do it..
You can try creating custom domain using registry for testing purposes only..

html code to open a file:// link in chrome browser that uses the chrome extension "open in IE" by default

Assuming everybody uses chrome browser;
So I am creating a wordpress blog for some friends. We use a shared network, and I want to create a link on that blog that when pressed opens up a folder in internet explorer.
The current html code is
I am using a chrome extension called "open in IE" , but to use it requires a right click then choosing an option within the menu. This process is too long and I want to simplify it.
Is there any html code I can write that make it open that file:// link using the "open in IE" extension by default? The goal is to be able to left click the link in chrome and have a window explorer open with the files in it.
Cheers
Unfortunately, targetting a specific browser to open on a clicked link is not possible.
Unless you modified some of their internal registry or used an activex plugin, it is just not a supported feature at this time.
You will most likely need to hard code some javascript.
I believe it is possible to reference installed extensions from your code using chrome.extensions.
Reference here, http://developer.chrome.com/extensions/extension.html

Internet Explorer Button simple behavior needs enabling ActiveX controls?

I have a button whose text color changes when the mouse is over it.
The HTML is :
<a href="products.html" style="text-decoration:none">
<div
class="button"
onmouseover="this.style.color='black'"
onmouseout="this.style.color='#666666'"><div class="menu_text">Products</div></div></a>
The thing is when I opened the page in IE8 , IE8 says:
To protect your security IE8 has restricted this page from running scripts or ActiveX controls that could access your computer.
in the information bar.
I click on options and allow blocked content.
Then it works fine.
Fancybox and GalleryView Plugins that I've included in my pages also are seen only when blocked content is allowed.
Is there a way to fix this?
I find that such an issue does not show here in the navigation bar buttons(home,random,about...). Why so?
By default IE blocks scripts when running websites locally - that is, from local file system. The warning should not appear when running on the server or on localhost.
See here: How do you avoid the drop-down ActiveX warning in IE7 and IE8?

HTML 5 Geo Location Browser prompt

I've a very simple HTML 5 app which tries to determine the users's current location.
Per the spec, supported browsers are supposed to show a prompt like this: "{XYZ} Would like to know your current location".
What does it work?
This is working fine if I open a broser window and directly open that page.
What it doesn't work?
However, when I get directed to that page via the link I don't see the prompt and an empty page. I have to refresh the page to see the browser prompt. I used FireFox 11 and Chrome on my iPhone 4.
Thanks,
You don't have any control over this as it's implemented by the browers.
As a side note, the Geolocation API is not part of HTML5, it's a W3C specification.