how to open mobile chrome browser with javascript or html

10,283

Solution 1

For Android:

<a href="intent:https://yourwebsite.com#Intent;end" target="_blank">Open Browser</a>

Note: This solution will open default browser (if its set, if no default browser set, it will show list of browsers which supports opening url)

Make sure that, the click is generated by user (Not Javascript) to test this. Some browsers wont open if its NOT called by user.

Solution 2

You can try following, It worked for me:

"googlechrome://navigate?url=" + url

i.e. window.open("googlechrome://navigate?url=" + url,"_system"); // here you can try with _system or _blank as per your requirement
Share:
10,283
minsu lee
Author by

minsu lee

Updated on June 05, 2022

Comments

  • minsu lee
    minsu lee almost 2 years

    I have two questions.

    //// I want this ////

    I want to open chrome browser with url on other android mobile webapp(ex naver, firefox, etc...) with using javascript or html

    so example) if user click MysiteButton on mobile web app, then open android device mobile chrome browser with redirect url(on chrome).

    what should i do.

    //// Question List ////

    1. i found that I should use deeplink or intent but i don't know android mobile chromebrower's intent url or Scheme url. what is android mobile chromebrower's intent url. how to get. ( i used window.location.href = "market://detail?id=com.android.chrome"; but not worked)

    2. when i use deeplink or intent, how to redirect url on chrome at the same time open chrome

  • titusfx
    titusfx almost 4 years
    your solution throw an error. Not allowed to load local resource: googlechrome://navigate?url=www.myurl.com
  • Shalanah
    Shalanah over 2 years
    I have been looking for an answer like this for a while... thanks! I tried it out on my pixel now to look for an iOS equivalent. Thanks! ❤️
  • JMad
    JMad over 2 years
    Do you know if there is an equivelant solution for IOS?
  • Ava Juan
    Ava Juan over 2 years
    Hey John, Thanks a lot. Will it work on iOS too?