从WebView中的链接打开Mobile Safari [英] Open Mobile Safari from a Link in a WebView

查看:134
本文介绍了从WebView中的链接打开Mobile Safari的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个URI方案可以将Mobile Safari打开到特定的URL?

Is there a URI scheme to open Mobile Safari to a specific URL?

例如,

<a href="safari://open_url/?url=google.com">Open Google in Safari</a>


推荐答案

更新
因此,从iOS 6.0.2开始,仍然没有特定于MobileSafari的URL方案(见下文)。然而,Federico Viticci发布了一个有趣的黑客,允许您从Chrome for iOS调用Safari。它没有Chrome-to-Safari书签那么实用,但它确实表明可以从Chrome for iOS推出MobileSafari。

Update: So, as of iOS 6.0.2, there is still isn't a URL scheme specific to MobileSafari (see below). However, Federico Viticci has posted an interesting hack that will allow you to call Safari from Chrome for iOS. It's not as functional as a Chrome-to-Safari bookmarklet, but it does show it's possible to launch MobileSafari from Chrome for iOS.

原始答案
事实证明,只使用URI方案就无法在Safari中打开链接。其他应用程序中的超链接可以使用 openURL 在Safari中打开(请参阅其他答案),但是没有针对MobileSafari本身的方案(如果要打开链接,则需要使用该方案)在Safari中使用Chrome或Opera for iOS中的超链接。)

Original Answer: It turns out you can't open a link in Safari using just a URI scheme. Hyperlinks in other apps can be opened in safari using openURL (see other answers), but there is no scheme for MobileSafari itself (which you would need if you were to open a link in Safari using a hyperlink in Chrome or Opera for iOS).

Google Chrome有以下两种URI方案: googlechrome:// googlechromes:// (对于HTTPS),其工作方式与任何其他特定于应用的方案一样(例如 dayone:// 件事:// sms:// )。

Google Chrome has the following two URI schemes: googlechrome:// and googlechromes:// (for HTTPS) that work just as any other app-specific scheme (such as dayone://, things://, or sms://).

这篇关于从WebView中的链接打开Mobile Safari的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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