问题
We've a web page that needs to be open in Chrome/Firefox on Android to fully display the content. But when we post the link on Facebook, it always opens the links with its own web browser.
So we're checking if there is a way to force opening the link in Chrome browser from a Facebook post.
Here are some approaches that we tried:
Use Chrome URL Scheme (googlechrome://navigate?url=example.com)
Use window.location.href, window.open (url,"_system"), etc
And even using the intent to launch chrome from the web browser: What is the intent to launch any website link in Google Chrome
If you have any idea or confirmation that there is no way to force users from Facebook Browser to Chrome (Android OS), please let us know.
回答1:
Up until recently the googlechrome://navigate?url=example.com approach worked on both Android/iOS Facebook links when using an href with target="_blank". Recently this stopped working on Android Facebook. The only workaround I have found that works is to use an intent: link that does not specify a package path for Chrome. It will open the link using the default browser, so is not guaranteed to be Chrome. The specific link format that worked was:
window.location = 'intent:https://example.com#Intent;end';
IT appears that the intent is matching a generic URL to use the default selected browser when no package is specified.
来源:https://stackoverflow.com/questions/58229510/url-scheme-to-open-chrome-firefox-android-os-from-facebook-post