Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App内置浏览器 #285

Open
yaofly2012 opened this issue Aug 31, 2023 · 0 comments
Open

App内置浏览器 #285

yaofly2012 opened this issue Aug 31, 2023 · 0 comments

Comments

@yaofly2012
Copy link
Owner

背景

最近一个项目需要在Native APP里打开第三方H5页面,但是对方要求不能采用WebView方式打开他们的页面。

In-App Browser和WebView

In-App Browser(App内置浏览器)是个概念,是指可以在App里直接展示Web页面内容,无需跳出当前APP用浏览器打开页面。
一直以为In-App Browser就是通过WebView方式实现的,Google下才知道除了WebView方式外还有其他方式可以实现In-App Browser:

  1. iOS:SFSafariViewController
  2. Android:Chrome Custom Tabs

为什么第三方不让用WebView

因为WebView太灵活了,App可以完全控制展示的页面内容,甚至可以注入JS(应用内浏览器被认为是有害的)。但这对于第三方的页面来说就不够安全了。SFSafariViewControllerChrome Custom Tabs就解决了WebView的问题。

参考

  1. SFSafariViewController
  2. Chrome Custom Tabs
  3. WebView vs Chrome Custom Tab
  4. 我应该在 App 内使用WKWebView还是SFSafariViewController来提供网络浏览体验?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant