Detect if page is loaded inside WKWebView in JavaScript

后端 未结 5 1241
闹比i
闹比i 2020-12-02 19:10

How can I reliably detect using javascript that a page is loaded inside a WKWebView? I\'d like to be able to detect these scenarios:

  • iOS & WKWebView
  • <
5条回答
  •  误落风尘
    2020-12-02 19:40

    It seems that because of the latest iOS Chrome using WKWebView as rendering engine, Chrome is detected as WKWebView. ua.indexOf('CriOS') !== -1 will helps to distinguish Chrome from WKWebView in App.

提交回复
热议问题