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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jun 7 07:00:21 PDT 2017


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

volker.graf at cartech-company.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |volker.graf at cartech-company
                   |                            |.com

--- Comment #12 from volker.graf at cartech-company.com ---
Has anybody a working fix for this Problem ??

I am trying to load a few local Images (located unter www/img/...) using mapbox-gl-js like

map.loadImage('file://img/car16.png', (error, image) => {
        if (error) {
                alert("Car16 image not loaded");
                console.error(error);
                throw error;
        }
        map.addImage('car16', image);
});


I modified - 
(WKWebViewConfiguration*) createConfigurationFromSettings:(NSDictionary*)settings
{
   ...
   ...
    @try {
        [configuration.preferences setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"];
    }
    @catch (NSException *exception) {}

    @try {
        [configuration setValue:@TRUE forKey:@"allowUniversalAccessFromFileURLs"];
    }
    @catch (NSException *exception) {}

    return configuration;
}

The Result I'm getting is

Failed to load resource: The requested URL was not found on this server. file://img/car16.png 

is there something I'm missing ??

-- 
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/20170607/1b730322/attachment.html>


More information about the webkit-unassigned mailing list