From a2ba4e0a6a873d11e4161763b309acf6a5bafddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20Lach=C3=A8ze?= Date: Thu, 20 Jul 2017 20:01:49 +0200 Subject: [PATCH] fix content scripts matches --- lib/renderer/content-scripts-injector.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/renderer/content-scripts-injector.js b/lib/renderer/content-scripts-injector.js index 7fbe3f5ef02c..7d0f34009224 100644 --- a/lib/renderer/content-scripts-injector.js +++ b/lib/renderer/content-scripts-injector.js @@ -26,9 +26,7 @@ const runContentScript = function (extensionId, url, code) { // Run injected scripts. // https://developer.chrome.com/extensions/content_scripts const injectContentScript = function (extensionId, script) { - for (const match of script.matches) { - if (!matchesPattern(match)) return - } + if (!script.matches.some(matchesPattern)) return for (const {url, code} of script.js) { const fire = runContentScript.bind(window, extensionId, url, code)