[ 
https://issues.apache.org/jira/browse/CB-11524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15392763#comment-15392763
 ] 

Shazron Abdullah commented on CB-11524:
---------------------------------------

The preference "WebKitAllowUniversalAccessFromFileURLsPreferenceKey" needs to 
be set to true for localStorage to work on iOS (by default this setting in 
WKSecurityOrigin is false): 
https://github.com/WebKit/webkit/blob/74c39d225ee2f6465806db45dedb8f351b56c7bd/Source/WebKit/mac/WebView/WebPreferences.mm#L441
 
(although it is set true here, for macOS). I don't think we can override this 
by setting a NSUserDefaults preference (although I haven't tried).

Similarly to the problem with loading local files in iOS 8 which was remedied 
in iOS 9 with "loadFileURL:allowingReadAccessToURL:"
https://developer.apple.com/library/ios/documentation/WebKit/Reference/WKWebView_Ref/#//apple_ref/occ/instm/WKWebView/loadFileURL:allowingReadAccessToURL:
... Apple will need to add a configuration setting for this. So far in the 
WebKit code I don't see anything for this yet.

> [iOS 10] Using localStorage with WKWebView gives a security error
> -----------------------------------------------------------------
>
>                 Key: CB-11524
>                 URL: https://issues.apache.org/jira/browse/CB-11524
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Plugin WKWebViewEngine
>            Reporter: Saúl Ibarra Corretgé
>            Assignee: Shazron Abdullah
>              Labels: wkwebview-known-issues
>
> When using window.localStorage on iOS 10 with WKWebView, the following error 
> happens: SecurityError: DOM Exception 18: An attempt was made to break 
> through the security policy of the user agent.
> This does not happen with UIWebView, or with WKWebView on iOS 9.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to