how to open mobile chrome browser with javascript or html
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
minsu lee
Updated on June 05, 2022Comments
-
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 ////
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)
when i use deeplink or intent, how to redirect url on chrome at the same time open chrome
-
titusfx almost 4 yearsyour solution throw an error. Not allowed to load local resource: googlechrome://navigate?url=www.myurl.com
-
Shalanah over 2 yearsI 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 over 2 yearsDo you know if there is an equivelant solution for IOS?
-
Ava Juan over 2 yearsHey John, Thanks a lot. Will it work on iOS too?