function pathFromURL()

in src/windows/FileProxy.js [239:264]


function pathFromURL (url) {
    url = url.replace(msapplhRE, 'ms-appdata:///');
    let path = decodeURIComponent(url);
    // support for file name with parameters
    if (/\?/g.test(path)) {
        path = String(path).split('?')[0];
    }
    if (path.indexOf('file:/') === 0) {
        if (path.indexOf('file://') !== 0) {
            url = 'file:///' + url.substr(6);
        }
    }

    // eslint-disable-next-line
    ['file://', 'ms-appdata:///', 'ms-appx://', 'cdvfile://localhost/'].every(function (p) {
        if (path.indexOf(p) !== 0) { return true; }
        const thirdSlash = path.indexOf('/', p.length);
        if (thirdSlash < 0) {
            path = '';
        } else {
            path = sanitize(path.substr(thirdSlash));
        }
    });

    return path.replace(driveRE, '$1');
}