From 582e9078af834a719b1ce04db09c63741b446380 Mon Sep 17 00:00:00 2001 From: eight Date: Mon, 8 Oct 2018 14:39:08 +0800 Subject: [PATCH] Fix: inject all scripts --- background/background.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/background/background.js b/background/background.js index 7158b165..85f1385c 100644 --- a/background/background.js +++ b/background/background.js @@ -268,12 +268,14 @@ window.addEventListener('storageReady', function _() { const injectCS = (cs, tabId) => { ignoreChromeError(); - chrome.tabs.executeScript(tabId, { - file: cs.js[0], - runAt: cs.run_at, - allFrames: cs.all_frames, - matchAboutBlank: cs.match_about_blank, - }, ignoreChromeError); + for (const file of cs.js) { + chrome.tabs.executeScript(tabId, { + file, + runAt: cs.run_at, + allFrames: cs.all_frames, + matchAboutBlank: cs.match_about_blank, + }, ignoreChromeError); + } }; const pingCS = (cs, {id, url}) => {