75341704 edited a comment on issue #883:
URL: https://github.com/apache/cordova-ios/issues/883#issuecomment-651476010


   
   > You should migrate your app to use schemes, which should solve this issue, 
among other `file://` related issues with the WKWebView. Do note however that 
switching schemes will cause you lose web storage such as indexedDB or local 
storage, as the origin of your app will change.
   > 
   > If you must use the `file://` scheme, then I would advise sticking with 
`[email protected]` for the time being. You need to use a plugin such as 
https://github.com/oracle/cordova-plugin-wkwebview-file-xhr, but it currently 
expects the wkwebview engine to be installed, which is incompatible with 
cordova-ios@6. I've raised an issue at 
[oracle/cordova-plugin-wkwebview-file-xhr#55](https://github.com/oracle/cordova-plugin-wkwebview-file-xhr/issues/55)
 to see if they can update the plugin to support cordova-ios@6.
   
   1. fork the cordova-plugin-wkwebview-file-xhr  and remove  the dependency 
cordova-plugin-wkwebview-engine in the plugin.xml 
   2. cordova plugin add [fork address]
   3. Add the code
       [configuration.preferences setValue:@"TRUE" 
forKey:@"allowFileAccessFromFileURLs"];
       [configuration setValue:@"TRUE" 
forKey:@"allowUniversalAccessFromFileURLs"];
   In 
   
https://github.com/apache/cordova-ios/blob/e6e90e07d1b04bf5fcafc14578f1c4fb8bd86386/CordovaLib/Classes/Private/Plugins/CDVWebViewEngine/CDVWebViewEngine.m#L72
   
   it works partially considering the  Known Issues of  
cordova-plugin-wkwebview-file-xhr 
   The plugin caches cookies at the native layer between requests but it does 
not attempt to sync cookies between the WKWebView and the native sessions. From 
the JavaScript context, this means "document.cookie" won't contain any cookies 
returned from XHR handled at the native layer and the native iOS XHR will not 
see any cookies returned from remote resources fetched by the browser context, 
such as images.
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to