Merge pull request #84 from ohadcn/master
make disable by regex active only on enabled sites
This commit is contained in:
commit
b73f7d7aaa
@ -171,10 +171,6 @@ browser.runtime.onInstalled.addListener(function (details) {
|
|||||||
|
|
||||||
|
|
||||||
browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
||||||
if (blockedRegexes.some(function(regex) { return regex.test(details.url); })) {
|
|
||||||
return { cancel: true };
|
|
||||||
}
|
|
||||||
|
|
||||||
var isEnabled = enabledSites.some(function(enabledSite) {
|
var isEnabled = enabledSites.some(function(enabledSite) {
|
||||||
|
|
||||||
var useSite = details.url.indexOf("." + enabledSite) !== -1;
|
var useSite = details.url.indexOf("." + enabledSite) !== -1;
|
||||||
@ -191,6 +187,10 @@ browser.webRequest.onBeforeSendHeaders.addListener(function(details) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (blockedRegexes.some(function(regex) { return regex.test(details.url); })) {
|
||||||
|
return { cancel: true };
|
||||||
|
}
|
||||||
|
|
||||||
var requestHeaders = details.requestHeaders;
|
var requestHeaders = details.requestHeaders;
|
||||||
var tabId = details.tabId;
|
var tabId = details.tabId;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user