以编程方式在阅读器模式下打开 Safari
是否可以以编程方式在阅读器模式下打开 Safari 和/或移动 Safari?
Is it possible to programmatically open Safari and/or mobile Safari in Reader mode?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
阅读器功能似乎部分源自可读性项目。可能值得阅读一些可以更详细地了解读者的资源。一些很好的起点,以及其他资源的链接:
关于操作 Safari/阅读器,我不知道 Apple 提供了任何相关 API,如果他们提供将网站放入阅读器的特定代码,我会感到惊讶模式。毕竟,如果遵循标准人机界面指南,调用此功能的选项实际上应该由用户启动。
The reader functionality appears to be derived, in part, from the Readability project. It might be worth reading up on a few of the resources out there which look at reader in more detail. Some good starting points, and links to other resources:
With regards manipulating Safari / reader, I'm not aware of any relevant API offered by Apple, and I'd be surprised if they offered specific code to put a site in reader mode. After all, the option to invoke this functionality should really be user-initiated if one is going by standard human interface guidelines.
如果您的用例适用于在应用程序中加载
SFSafariViewController
而不是打开 Safari 应用程序,您可以通过配置将阅读器模式设置为 trueIt it works for your use case to load
SFSafariViewController
within the app instead of opening Safari app, you can set reader mode to true via config如果您有 URL,则可以使用 UIApplication 的 openURL 方法,该方法将为您打开该 URL。
If you have a URL, then you can use the openURL method of UIApplication which will open the URL for you.