[Webkit-unassigned] [Bug 154916] WKWebView needs feature to allow file:// subresources

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Sep 19 02:37:08 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=154916

Guillaume Ripoche <guillaume.ripoche at mobile-spot.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |guillaume.ripoche at mobile-sp
                   |                            |ot.com

--- Comment #26 from Guillaume Ripoche <guillaume.ripoche at mobile-spot.com> ---
Hello

I thought I would fill a new bug report but our issue is very similar to this one.

TL;DR WKwebview does not access resources downloaded in data directory.

-

Version: 603.3.8

Reproduced on:
 - iphone 5 running iOS 10.3.3
 - iphone 6 running iOS 11 then iOS 12.0

-

With UIwebview deprecation announcement we started the work to migrate to WKwebview. Being cordova users we followed the instructions here:
https://cordova.apache.org/news/2018/08/01/future-cordova-ios-webview.html

Basically on cordova you need to add two plugins:
 - cordova-plugin-wkwebview-engine to use the WKwebview
 - cordova-plugin-wkwebview-file-xhr to fix XHR requests

-

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 using the former UIwebview.

*

In the network panel of Safari's web inspector (which allows to inspect a cordova app in the same manner), 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).

As stated in above comments: using temp directory works (thanks for the tip!) but needs extra work and startup time.

Is webkit webview deliberately forbidding data directory access?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180919/d1e88788/attachment.html>


More information about the webkit-unassigned mailing list