fix: for in to of

This commit is contained in:
eson 2020-09-02 18:39:21 +08:00
parent 0b2687ecfa
commit a019b6157a
2 changed files with 14 additions and 9 deletions

View File

@ -1,9 +1,12 @@
var app = {};
chrome.webRequest.onBeforeRequest.addListener(function (e) {
if(e.url.startsWith("https://video-")) {
return {"cancel": true};
};}, {"urls": ["*://*/*"]}, ["blocking"]);
for(var u of ["https://video-", "https://txvid.vod"]) {
if(e.url.startsWith(u)) {
return {"cancel": true};
};
}
}, {"urls": ["*://*/*"]}, ["blocking"]);
app.version = function () {return chrome.runtime.getManifest().version};
app.homepage = function () {return chrome.runtime.getManifest().homepage_url};

View File

@ -33,13 +33,15 @@ core.webrequest = {
"blocking": {"types": []},
"block": function (e) {
if(e.url.startsWith("https://video-")) {
return {"cancel": true};
};
// if(e.url.startsWith("https://video-")) {
// return {"cancel": true};
// };
if(e.url.startsWith("https://txvid.vod")) {
return {"cancel": true};
};
for(var u of ["https://video-", "https://txvid.vod"]) {
if(e.url.startsWith(u)) {
return {"cancel": true};
};
}
var ftp = e.url.indexOf("ftp") === 0;
var http = e.url.indexOf("http") === 0;