[英]in iOS, is there a way to detect if a web page is loaded with SFSafariViewController vs the normal Safari Browser using Javascript?
Is there a way to detect if a web page is loaded with SFSafariViewController
vs the normal Safari Browser using Javascript?有没有办法检测 web 页面是否加载了SFSafariViewController
与使用 Javascript 的普通 Safari 浏览器?
@supports (-webkit-touch-callout: none) {
/* CSS specific to iOS devices */
}
@supports not (-webkit-touch-callout: none) {
/* CSS for other than iOS devices */
}
You can check for the existence of the obscure system font .Helvetica LT MM
in a canvas.您可以检查 canvas 中是否存在晦涩的系统字体.Helvetica LT MM
。 Use the following Github Gist, and then call isInsideSFSafariViewController()
.使用以下 Github Gist,然后调用isInsideSFSafariViewController()
。
Note that this can break at any time with a new release, so your code should gracefully fall back.请注意,随着新版本的发布,这可能随时中断,因此您的代码应该优雅地回退。
https://gist.github.com/aeharding/08eaafbb7742f78ede9b8d2f5d096354 https://gist.github.com/aeharding/08eaafbb7742f78ede9b8d2f5d096354
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.