mirror of
https://github.com/gorhill/uBlock.git
synced 2026-03-11 09:04:36 +00:00
Simplify a bit 9e43852 by using Array.every()
This commit is contained in:
parent
0714aceaaf
commit
016625465e
1 changed files with 5 additions and 5 deletions
|
|
@ -1057,12 +1057,12 @@ vAPI.warSecret = (function() {
|
|||
|
||||
const guard = function(details) {
|
||||
const url = details.url;
|
||||
for ( let i = 0, n = secrets.length; i < n; i++ ) {
|
||||
if ( url.indexOf(`?secret=${secrets[i]}`) !== -1 ) {
|
||||
return;
|
||||
}
|
||||
const r = secrets.every(secret => {
|
||||
return url.indexOf(`?secret=${secret}`) === -1;
|
||||
});
|
||||
if ( r ) {
|
||||
return { redirectUrl: root };
|
||||
}
|
||||
return { redirectUrl: root };
|
||||
};
|
||||
|
||||
chrome.webRequest.onBeforeRequest.addListener(
|
||||
|
|
|
|||
Loading…
Reference in a new issue