From 016625465e5600f3cf64fb96f621f78b95436e51 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Tue, 30 Apr 2019 16:18:40 -0400 Subject: [PATCH] Simplify a bit 9e43852 by using Array.every() --- platform/chromium/vapi-background.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/chromium/vapi-background.js b/platform/chromium/vapi-background.js index 751138ffe..09a274cb7 100644 --- a/platform/chromium/vapi-background.js +++ b/platform/chromium/vapi-background.js @@ -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(