URL模式可从Facebook发布打开Chrome/Firefox(Android OS) [英] URL Scheme to open Chrome/Firefox (Android OS) from Facebook post

查看:67
本文介绍了URL模式可从Facebook发布打开Chrome/Firefox(Android OS)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个网页需要在Android上的Chrome/Firefox中打开,以完整显示内容.但是,当我们在Facebook上发布链接时,它总是使用自己的网络浏览器打开链接.

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.

因此,我们正在检查是否有一种方法可以从Facebook帖子中强制在Chrome浏览器中打开链接.

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:

  1. 使用Chrome URL方案(googlechrome://navigate?url = example.com)

  1. Use Chrome URL Scheme (googlechrome://navigate?url=example.com)

使用window.location.href,window.open(URL,"_ system")等

Use window.location.href, window.open (url,"_system"), etc

甚至使用意图从Web浏览器启动chrome: 启动任何网站的意图是什么Google Chrome浏览器中的链接

And even using the intent to launch chrome from the web browser: What is the intent to launch any website link in Google Chrome

如果您有任何想法或确认无法将用户从Facebook浏览器强制转换为Chrome(Android OS),请告知我们.

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.

推荐答案

直到最近,当使用带有target ="_ blank的href时,googlechrome://navigate?url = example.com方法在两个Android/iOS Facebook链接上均有效".最近,这已停止在Android Facebook上运行.我发现唯一可行的解​​决方法是使用一个intent:链接,该链接未指定Chrome的程序包路径.它将使用默认浏览器打开链接,因此不能保证是Chrome.有效的特定链接格式为:

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 ='意图: https://example.com#Intent; end ' ;

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

如果未指定包,则表明该意图与通用URL匹配以使用默认选择的浏览器.

IT appears that the intent is matching a generic URL to use the default selected browser when no package is specified.

这篇关于URL模式可从Facebook发布打开Chrome/Firefox(Android OS)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆