WKWebView Data:" WKWebsiteDataRecord, WKWebsiteDataStore"

How can I use the webSQL in the web application that used the WKWebView?


In the Apple documentation of the WebKit framework explain that WKWebView supports the WebSQL.

"WKWebsiteDataStore

A

WKWebsiteDataStore
object represents various types of data used by a chosen website. Data types include cookies, disk and memory caches, and persistent data such as WebSQL, IndexedDB databases, and local storage."


Thanks in advance


Hi!

WebSQL support was removed from Safari 13 (iOS 13 and macOS 10.15)

You can see this noted here

IndexedDB is the replacement for WebSQL.

WKWebsiteDataStore still supports WebSQL data types, as websites might have left WebSQL data behind before a user updated their OS, for example.
Hi,

One of the components of our application uses UIWebView and it's support of webSQL.
Now, We are upgrading the app according to Apple's guidelines and switching from UIWebView to WKWebView. 

But we were unsuccessful migrating to WKWebView and getting webSQL to work.

My Native code is really simple:
 

WKWebViewConfiguration *conf = [[WkWebViewConfiguration alloc] init]  
self.webView = [[WkWebView alloc] initWithFrame:self.view.bounds configuration:conf];     
[self.webView loadRequest[NSUrlRequest requestWithURL:[NSURL URLWithString:@"....................."]]];  
 
And our javascript  
 
 var db = window.openDatabase('local_db', '1.0', 'local database', 200 * 1024 * 1024);

We always get the following error message "Error: SecurityError: DOM Exception 18"...

You said that "WKWebsiteDataStore still supports WebSQL data types". Can you please help us on how to use webSQL under WKWebView in our application.

Our app use the iOS sdk 13.5 and Xcode version 11.5.

WKWebView Data:" WKWebsiteDataRecord, WKWebsiteDataStore"
 
 
Q