fix: for in to of
This commit is contained in:
parent
0b2687ecfa
commit
a019b6157a
|
@ -1,9 +1,12 @@
|
||||||
var app = {};
|
var app = {};
|
||||||
|
|
||||||
chrome.webRequest.onBeforeRequest.addListener(function (e) {
|
chrome.webRequest.onBeforeRequest.addListener(function (e) {
|
||||||
if(e.url.startsWith("https://video-")) {
|
for(var u of ["https://video-", "https://txvid.vod"]) {
|
||||||
|
if(e.url.startsWith(u)) {
|
||||||
return {"cancel": true};
|
return {"cancel": true};
|
||||||
};}, {"urls": ["*://*/*"]}, ["blocking"]);
|
};
|
||||||
|
}
|
||||||
|
}, {"urls": ["*://*/*"]}, ["blocking"]);
|
||||||
|
|
||||||
app.version = function () {return chrome.runtime.getManifest().version};
|
app.version = function () {return chrome.runtime.getManifest().version};
|
||||||
app.homepage = function () {return chrome.runtime.getManifest().homepage_url};
|
app.homepage = function () {return chrome.runtime.getManifest().homepage_url};
|
||||||
|
|
|
@ -33,13 +33,15 @@ core.webrequest = {
|
||||||
"blocking": {"types": []},
|
"blocking": {"types": []},
|
||||||
"block": function (e) {
|
"block": function (e) {
|
||||||
|
|
||||||
if(e.url.startsWith("https://video-")) {
|
// if(e.url.startsWith("https://video-")) {
|
||||||
return {"cancel": true};
|
// return {"cancel": true};
|
||||||
};
|
// };
|
||||||
|
|
||||||
if(e.url.startsWith("https://txvid.vod")) {
|
for(var u of ["https://video-", "https://txvid.vod"]) {
|
||||||
|
if(e.url.startsWith(u)) {
|
||||||
return {"cancel": true};
|
return {"cancel": true};
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var ftp = e.url.indexOf("ftp") === 0;
|
var ftp = e.url.indexOf("ftp") === 0;
|
||||||
var http = e.url.indexOf("http") === 0;
|
var http = e.url.indexOf("http") === 0;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user