[英]Is there any way to force a link to open in Chrome from Facebook's in-app browser?
I've got a web app that requires the ability to print. 我有一个需要打印能力的网络应用程序。 Facebook's in-app implementation of Chrome doesn't allow printing.
Facebook的应用内Chrome实现不允许打印。 Currently, I'm giving the user instructions on how to open in chrome themselves in place of the print button I give normal users.
目前,我正在向用户提供有关如何打开chrome本身的说明,而不是我给普通用户打印的按钮。 But I'd prefer to just open Chrome for them when they get to that page, or at the very least provide a button/link that would open the page in Chrome instead of forcing them to find the settings button and figure out how to open Chrome themselves.
但我希望只是在他们到达该页面时为他们打开Chrome,或者至少提供一个按钮/链接,可以在Chrome中打开该页面而不是强制他们找到设置按钮并找出如何打开Chrome自己。
I've tried using the googlechrome://myurl.com approach, and Chrome opens, but the specified url doesn't load. 我尝试使用googlechrome://myurl.com方法,Chrome打开,但指定的网址没有加载。
I've looked into Google's Intent option but I wasn't able to figure out how to open Chrome with that method. 我查看了Google的Intent选项,但我无法弄清楚如何使用该方法打开Chrome。
Is there a way to accomplish this in javascript? 有没有办法在javascript中实现这一点? or by some url scheme in an href attribute?
或者通过href属性中的某个url方案?
So far, all the other answers I've found give explanations for how to do this from an Android App, but not from a website. 到目前为止,我发现的所有其他答案都解释了如何从Android应用程序执行此操作,而不是从网站进行解释。
** Update: The googlechrome://myurl.com seems to work fine from iOS in the native facebook app. **更新:googlechrome://myurl.com似乎在原生Facebook应用程序中从iOS正常工作。 It does not appear to work correctly using the native facebook app in Android.
使用Android中的原生Facebook应用程序似乎无法正常工作。
Try 尝试
googlechrome://navigate?url=example.com
googlechrome://浏览URL = example.com
for Android users. 适用于Android用户。
Reference from https://stackoverflow.com/a/12013755/9514189 参考https://stackoverflow.com/a/12013755/9514189
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.