How To Launch A URL In Google Chrome

Scenario:
We want to open a particular URL in Google Chrome, but the default browser is Internet Explorer. Most company apps either support or require Internet Explorer, so we don’t want to change the default browser – but one app works better in Chrome.

We could create a desktop shortcut using chrome.exe -url http://webpage.com, but the site is also linked from our Intranet – how do we get the link to always launch in the preferred browser?

 

Update 21st Dec 2016

Updates to Chrome seem to have broken this. Thanks to Chris Done for working with me on this fix:

1.Add the String Value of “URL Protocol” with a blank value to:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\] or [HKEY_CLASSES_ROOT\Chrome]
(they’re one and the same)
“URL Protocol”:””

2. Modify the value of

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open\command\Default]
“C:\Program Files (x86)\Google\Chrome\Application\chrome.exe” — %1

3. Use a space in the URL after the // you’re using for your link:

ChromeHTML:// adamfowlerit.com

4. Create this key to remove the prompt on opening the link:
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\ProtocolExecute\ChromeHTML]
“WarnOnOpen”=dword:00000000

Here’s the registry settings you can copy and paste into a .reg file and import:

Copy from the next line

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML]
@=”Chrome HTML Document”
“URL Protocol”=””

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\DefaultIcon]
@=”C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe,0″

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open]

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open\command]
@=”\”C:\\Program Files (x86)\\Google\\Chrome\\Application\\Chrome.exe\” — %1″

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\ProtocolExecute\ChromeHTML]
“WarnOnOpen”=dword:00000000

Copy stops above this line

End of update 21st Dec 2016

Answer:
URI Schemes. Any program can be launched using a protocol (you can see which ones you already have in Windows under Control Panel > Default Programs > Associate a file type or protocol with a program > Scroll past all the extensions down to the protocols.

You may have something like ‘MAILTO’ which is used in the format “Mailto:”. Type that into your browser and it will either launch a new email from your default mail client, or ask you to set a default mail client.

Some apps automatically create their own protocol, but you can also create your own through registry entries. Details from MSDN are available here.

Luckily for Chrome, this is already done for you, using ChromeHTML. This means you should be able to call Chrome with “ChromeHTML:” and insert the URL you want after it to open – except it doesn’t work. Chrome will open, but no URL is passed over.

A user has logged this bug with Google several months ago, it hasn’t been fixed. There is a workaround though, that can easily be done via group policy to change a local registry setting.

As this user mentions, a quote needs to be taken out of the following registry key, so it looks like this:

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open\command]
@="\"C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\" -- %1"

The quote removed was before the % sign.

Once this is done, the ChromeHTML protocol can be used with a URL, as long as it’s in this format:

ChromeHTML:// google.com

Note the space after the slashes.

The next issue you will notice, is that Internet Explorer will most likely prompt when launching the URL, asking ‘Do you want to allow this website to open a program on your computer?’ – there is a tickbox you can remove to ‘Always ask before opening this type of address’ but this can also be suppressed via the registry.

Snapcomms have an article on how to do it with their product, but the same rules apply for Google Chrome, as long as you use the right key:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\ProtocolExecute\ChromeHTML]
“WarnOnOpen”=dword:00000000

Once this key exists, the prompt will no longer show for that particular protocol.

That’s it, now you can use a URL link such as “ChromeHTML:// adamfowlerit.com” on your intranet page to launch the website of your choice in Chrome browser.

 

 

39 thoughts on “How To Launch A URL In Google Chrome

  1. Thank you for useful article! I could convert browser successfully without any security concern ! BTW I also tried removing a pop-up window, My pc doesn’t have ‘Internet Explorer’ under Wow6432Node… In this case,will it be work if I make a new path in the registry?? Many thanks in advance

    1. Happy to help :) That may be because you’re on a 32 bit install of Windows, in which case that won’t exist. Ignore that part, does the rest of the path exist? I.e. Software > Microsoft > Internet Explorer > etc?

      1. Thanks you for prompt reply ! how fast !
        Under Wow6432Node > Microsoft, I only have Windows . I found a path similar to post’s path … [HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
        This is the bottom path of WOW6432Node.
        I also have ‘Authentication’ folder under ‘CurrentVersion’ path

    1. Aww I mean after I applied ChromeHTML in the webpage, the message ‘Do you want to allow this website to open a program on your website? — IE browser address , program:Google Chrome, the site address that I wanna open info ‘ pops up . and also with the checkbox ‘‘Always ask before opening this type of address’ ‘

      1. Ah, did you check the SnapComms article? There’s a few different regsitry keys there to try.

      2. After adding ‘WarnOnOpen’ in the HKLM: to affect local machine – for 32 bit machines path, IT WORKS !!! Yayyyy Thank you for your kind reply. I really appreciate ;)

  2. Hi, I know this article is old. But I tried changing the registry value and changing Program Files with Program Files (x86), since this is a 64 bit machine. I still have the issue of unable to use chromeHTML protocol. Is this tested to work as of today?

    1. Hi Javier,
      I can test again – this was done on a 64 bit PC, but are you using 64 bit Chrome? Not sure if that has a different hive in the registry for it’s settings.

      On the bug report, someone commented only 2 days ago saying it was still an issue.

  3. Thanks Adam, for a very helpful article here. I am facing one small issue after following the steps listed. The URL opens in Chrome Browser – but – only if a Chrome Browser instance is already running on my computer. If I close the Chrome Browser process, clicking on the link brings up the alerts/pop ups but then Chrome Briwser does not open up. Any suggestions on how to handle this?

    1. Glad to hear it – at a guess, your [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open\command] key is wrong. Look at it via Registry Editor, copy the value (which should point to chrome.exe) and see if it launches if you paste it into the run window. If that’s wrong, you’d have the exact problem you’re seeing.

      Note it’s a bit confusing between the view you see in Registry Editor, vs the value you see if that value is exported with all the double slashes etc, if you enter the string with the slashes via the editor it’ll break.

    2. Hey Raj, I was having similar issues, and when using the existing ChromeHTML protocol I was unable to overcome this.
      What we ended up doing is creating our own Protocol, identical to ChromeHTML on every point except for name, and this worked consistently to the point we now use it live.

  4. Hi,

    That worked perfectly for me, however I need something that does not involve adding ChromeHTML:// before the url. Is such thing possible please ?

    1. Hey Darren,
      I don’t see how it is, a URL of any sort is tied to your browser program as a protocol. If you’re able to elaborate on the scenario maybe we can come up with some creative way of doing it – what’s the roadblock to putting that link at the start (public website maybe?)

    2. In our scenario, we had two major challenges to overcome:
      * SharePoint 2010 not supporting non-standard URL protocols.
      * IE9 doesn’t recognize a lot of JavaScript.

      To get around SharePoint’s limitation on URL protocols/prefixes, one of our developers were kind enough to host a http: redirect that, using JavaScript, would immediately redirect to our custom protocol. This worked swimmingly, we started rolling the registry changes out across the fleet, and all was well.

      Then we tested in our terminal services environment. Due to an unfortunate core system support requirement, our “primary” browser is Internet Explorer 9 (whereas physicals are 11). This immediately posed a problem, because the link our developer had created for us did not work. Long story short, IE9 doesn’t play nicely with a lot of JavaScript, especially the modern code our dev put together.

      What we ended up going live with was an iFrame on our Intranet (powered by SharePoint), of a HTML page including only a border-less image hooked with a hyperlink to our custom protocol.

  5. thanks for the guide, it worked :)
    I was wondering if it is possible to work the other way ? to create a link which will launch IE
    I found in the registry the IE.HTTP protocol handler which launches IE, but i cannot pass the link correctly so it opens the website
    have you tried this ?

    1. Hi Nasser,
      I can’t recall if I’d tried the other way before, but a bit of google searching didn’t show an inbuilt way of doing that. You should be able to create and deploy your own protocol the same way though, maybe use ‘ie’. Let us know how you go!

  6. Excellent Article! Everything worked as mentioned in the post. One quick question is, why do we need a space between protocol and the URL? Can this be resolved to not have spaces?

    1. I cannot get this to work for me. All of my registry changes are identical to what is above.

      When I create the hyperlink in Outlook I get “Access is denied”.
      When I create the hyperlink in Word I get “The required Internet protocol is not installed on your computer, or the Internet address you requested may not be valid.”

      I have no tried opening this in IE though. Thoughts?

      1. I can confirm that using the link “ChromeHTML:// google.com” in Word 2016 works for me, so I’d be double checking the registry settings or testing on a different computer. It sounds like it’s not recognising the ChromeHTML protocol at all.

    2. No idea on the space – only way I could get it to work. Because it’s been years and Google don’t seem to be bothering to fix the issue, they probably did something wrong in the first place :)

  7. thank you for the code, But i have a issue its opening a different browser but defaulting to google.com istead of the url i am providing.

    1. Are you using a link with a space in it? If you don’t have the space, it’ll go to your default home page in Google:

      Right: ChromeHTML:// adamfowlerit.com
      Wrong: ChromeHTML://adamfowlerit.com

      1. //**
        [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML]
        @=”Chrome HTML Document”
        “URL Protocol”=””

        [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\DefaultIcon]
        @=”C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe,0?

        [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell]

        [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open]

        [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\ChromeHTML\shell\open\command]
        @=”\”C:\\Program Files (x86)\\Google\\Chrome\\Application\\Chrome.exe\” — %1?

        [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\ProtocolExecute\ChromeHTML]
        “WarnOnOpen”=dword:00000000

        **//

        Open Chrome Browser

  8. Hey Adam,
    Thanks for your work – this worked perfectly for us from IE to Chrome.
    One question – are you aware of any amendments that could be made to allow for this to work out of Outlook etc.
    We have HTML email templates that we would like to open links in Chrome from. It appears that when opening from Outlook this will launch Chrome but with /blank window.
    Thanks again

    1. Hi Grant,
      For the emails, are you using the format above with the space – e.g. ChromeHTML:// adamfowlerit.com ? The format above should be a system wide setting.

      If you’re thinking of being able to craft an email and send it to an external recipient to force them to open in Chrome, that’s not possible with this method (or any other way I know of).

      1. Thanks for the reply Adam – Unfortunately I also had the same issue as a previous comment (above) and this only opened when an instance of Chrome was already open. It was for that reason I created a new key (everything the same but the name) and this worked perfectly from browser to browser. And no, the email will be sent internally only and the Reg keys have been amended for all accordingly. Strangely it can’t seem to handle passing the URL address from email

      2. Further to that, if i revert back to ChromeHTML:// adamfowlerit.com ; it still only opens a new instance of Chrome with a blank tab (from email/Outlook). Browser to browser is fine

      3. And sorry Adam… just to add, this works in every other office product (word, excel, powerpoint) as expected. Outlook on the other hand only launches a new blank tab…

  9. Hello fellow ChromeHTML evangelists. It appears that we all have come across some requirement to open some webpages exclusively in Google Chrome.

    I had such a requirement and successfully deployed the following to a 1200 strong fleet.

    Background:
    A little about my scenario. Due to “reasons” my organisation at the time were still humbly tied to Internet Explorer 9 due to certain core web applications, vital to the business.
    HR went ahead and signed onto an Oracle cloud solution for their workforce management solution (without IT engagement). Obviously the day came where they needed IT to provision a method to access this new solution, preferably a simple link on the SharePoint home page. Here is where the fun began.

    Problems with ChromeHTML:
    As Adam details in this post, when Google Chrome is installed, a new URL protocol, or class, is created with the name ChromeHTML. In testing, I was getting some odd and inconsistent experiences while browsing to my Chrome-exclusive website using it.

    Create your own class:
    I ended up forgetting about fixing Google Chrome’s broken child, and went about creating my own. After more than enough research into Windows classes, I figured it was pretty straight forward. In my organisation I decided to do away with the wildcard, and embedded the URL into the protocol. The end result was that the hyperlink/URL needed to only contain the name of your class and a colon. E.g. AdamFowler:

    Example reg import:
    I created an example protocol to test with using Adam’s website URL. Copy and paste this into a *.reg file and execute. It will create the registry entries that govern the custom class. (Don’t include the tags.

    Results:
    Using the above example, when you enter ‘AdamFowler:’ into the URL of Internet Explorer, or any browser for that matter, it will call upon the class AdamFowler and execute our command, in this case chrome.exe and launching https://www.adamfowler.com.

    This will work anytime you browse to the URL containing your protocol. I’ve tested this from within a browser, as well as within an email in Outlook 2016.

    You will experience a warning message and possibly a browser select message in Windows 10, depending on which application you launch from. Clicking Yes and/or Ok to these will lead you to the desired result – your website is loaded exclusively in Chrome.

    Summary:
    You will need to figure out the suppression of warnings and messages depending on your end user environment. In our case we put the responsibility on the business unit to communicate the messages and define a desired process for progressing them.

    So that’s a bit long winded, but it’s what we did and why. Hope it clears some stuff up.

    1. Here’s the registry values for the above:

      [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\connect]
      “UseOriginalUrlEncoding”=dword:00000001
      “URL Protocol”=””
      @=”URL:AdamFowler”

      [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AdamFowler\DefaultIcon]
      @=”C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe”

      [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AdamFowler\shell]

      [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AdamFowler\shell\open]

      [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\AdamFowler\shell\open\command]
      @=”\”C:\\Program Files\\Google\\Chrome\\Application\\chrome.exe\” adamfowlerit.com ”

      1. Thank guys,
        After playing around with it yesterday I also came to the same conclusion that we may need to hardcode the address into the reg file. This is the only way I could get it to launch from within Outlook. Appreciate all you hard work

Leave a Reply