afioletov commented on issue #1134:
URL: https://github.com/apache/cordova-ios/issues/1134#issuecomment-896736776


   I created simple swift application that does the same: load file from bundle 
and tries to change location to data folder (cache). It fails the same way.
   
   Actually WebKit can load files from data container as well. I changed 
loadRequest method and load file from cache if it exists.
   ```
   
               NSArray *paths = 
NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
               NSString *cacheDirectory = [paths objectAtIndex:0];
               
               NSURL *nsurl = [NSURL fileURLWithPath:[[[cacheDirectory 
stringByAppendingPathComponent:@"1.11.00000.0000"] 
stringByAppendingPathComponent:@"www"] 
stringByAppendingPathComponent:@"Bootloader.html"]]; //locally
               NSURL *readAccessToURL1 = [NSURL fileURLWithPath:@"/"];
               if(nsurl)
                   return [(WKWebView*)_engineWebView loadFileURL:nsurl 
allowingReadAccessToURL:readAccessToURL1];
   
   
   ```
   It works fine, but it cannot load scripts from bundle. Looks like WebKit 
fails to crossing borders between containers within sandbox. Is there any 
configuration settings to allow it?
   
   I created a [bug](https://bugs.webkit.org/show_bug.cgi?id=228991) in 
webkit's bugzilla.


-- 
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.

To unsubscribe, e-mail: [email protected]

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