admin管理员组

文章数量:1410737

I am having a website in which i am using api's like push notification ,but when anyone open via Facebook or Twitter they tend to load an Android webview in which push notification api's are not there, the hack which i found is that if i can open chrome from webview in this way my push notification would work

it had tried

window.open("googlechrome://navigate?url=" + location.href, "_system")

but this gives error as Not allowed to load local resource:

need help from you all

I am having a website in which i am using api's like push notification ,but when anyone open via Facebook or Twitter they tend to load an Android webview in which push notification api's are not there, the hack which i found is that if i can open chrome from webview in this way my push notification would work

it had tried

window.open("googlechrome://navigate?url=" + location.href, "_system")

but this gives error as Not allowed to load local resource:

need help from you all

Share Improve this question edited May 19, 2020 at 10:34 Pranay Dutta asked May 18, 2020 at 11:49 Pranay DuttaPranay Dutta 2,5892 gold badges33 silver badges46 bronze badges 4
  • did you tried this way? window.open("googlechrome://navigate?url=" + location.href,'_system','location=yes'); – Shoma Commented May 19, 2020 at 3:09
  • @Shoma,tried ,same error – Pranay Dutta Commented May 19, 2020 at 8:44
  • what do you store in "location.href"? – Shoma Commented May 19, 2020 at 9:34
  • It gives u the current url – Pranay Dutta Commented May 19, 2020 at 9:40
Add a ment  | 

1 Answer 1

Reset to default 6

As posted over here use the below code

window.location = 'intent:https://example.#Intent;end';

本文标签: How to open google chrome from webview via javascriptStack Overflow