You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/09/18 08:46:36 UTC

[GitHub] guirip opened a new issue #56: WKwebview cannot load resources outside of app directory

guirip opened a new issue #56: WKwebview cannot load resources outside of app directory
URL: https://github.com/apache/cordova-plugin-wkwebview-engine/issues/56
 
 
   Hello
   
   I know this might not be the proper place because it may purely be a WKwebview bug, anyway if anyone has experienced this issue, knows about a possible work-around, or can point me to a more appropriate support I will be interested. Thanks.
   
   (originally posted on [stack-overflow](https://stackoverflow.com/questions/52373061/webkit-webview-wkwebview-cannot-load-resources-outside-of-app-directory))
   
   As **UIWebview** is now deprecated we started to use the **WKwebview**. We added `cordova-plugin-wkwebview-engine` as described here: https://cordova.apache.org/news/2018/08/01/future-cordova-ios-webview.html (and also `cordova-plugin-wkwebview-file-xhr`)
   
   1 - First, our app is built and shipped including assets (icons, images, etc) whose path looks like:
   `file:///var/containers/Bundle/Application/[APP_ID]/[APP_NAME]/www/files/project/home/iconA.svg`
   
   These assets are correctly displayed.
   
   2 - Then on startup the app also checks with our backend if there is any update available. If some assets have been updated, then the app downloads them in the data directory. The path to the above asset becomes:
   `file:///var/mobile/Containers/Data/Application/[APP_ID]/Library/NoCloud//V1/files/project/home/iconA.svg`
   
   ...but these assets are not displayed.
   
   NB1: In both cases, the resource is declared in a background-image css property.
   NB2: We've been using this process for years with success with the former UIwebview.
   
   In the network panel of Safari's web inspector, the resource appears in red, with a red message indicating that an error occurred while trying to load it. There is no error code, nothing technical to help, no more specific than this fuzzy message...
   
   I ran some tests and it appears that **the resource is present** on the file system at the given path. (Using `cordova-plugin-file` I can output the svg content).
   
   So, first conclusion would be that the WKwebview cannot access resources outside of app directory? As anyone any information, experience to share?
   
   Any help would be greatly appreaciated.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org