Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if phonegap app using WKWebview

Could not find information. I built pg app with 'cordova-plugin-wkwebview-engine'.

How to check if phonegap web app on ios 9.2 is really using WKWebview? Could not find info how userAgent string should look like for WKWebView.

like image 344
WHITECOLOR Avatar asked Jan 16 '16 21:01

WHITECOLOR


People also ask

Is WKWebView deprecated?

Since then, we've recommended that you adopt WKWebView instead of UIWebView and WebView — both of which were formally deprecated. New apps containing these frameworks are no longer accepted by the App Store.

Is WKWebView the same as Safari?

WKWebView - This view allows developers to embed web content in your app. You can think of WKWebView as a stripped-down version of Safari. It is responsible to load a URL request and display the web content. WKWebView has the benefit of the Nitro JavaScript engine and offers more features.

How do I use WKWebView?

Here's how: Open the XIB or Storyboard you want to add the web view to in Interface Builder. Find the web view or WKWebView in the Object Library at the bottom-left of Interface Builder. Drag-and-drop a WKWebView object from the Object Library to your view controller's canvas, and adjust its size and position.

What is WKWebView?

A WKWebView object is a platform-native view that you use to incorporate web content seamlessly into your app's UI. A web view supports a full web-browsing experience, and presents HTML, CSS, and JavaScript content alongside your app's native views.


1 Answers

Previous answer doesn't work on iOS 10, but you can use this code

if (window.webkit) {
    //WKWebView            
}

Old answer: You can check for indexedDB

if (window.indexedDB) {
    //WKWebView
}
like image 158
jcesarmobile Avatar answered Nov 15 '22 07:11

jcesarmobile