[CRX] Stop intercepting ftp in Chrome 59+

The extension cannot easily fetch data from ftp:-resources any more
in Chrome 59+. So don't intercept such URLs.
This commit is contained in:
Rob Wu 2018-03-21 15:44:31 +01:00
parent b67f117b56
commit df516c0a52

View File

@ -153,10 +153,16 @@ chrome.webRequest.onBeforeRequest.addListener(
urls: [
'file://*/*.pdf',
'file://*/*.PDF',
...(
// Duck-typing: MediaError.prototype.message was added in Chrome 59.
MediaError.prototype.hasOwnProperty('message') ? [] :
[
// Note: Chrome 59 has disabled ftp resource loading by default:
// https://www.chromestatus.com/feature/5709390967472128
'ftp://*/*.pdf',
'ftp://*/*.PDF',
]
),
],
types: ['main_frame', 'sub_frame'],
},