Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

ios - Open Mobile Safari from a Link in a WebView

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

e.g.,

<a href="safari://open_url/?url=google.com">Open Google in Safari</a>
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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 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://).


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...