From 4be9dc0413462cfaacb04517cfeef50cf2503074 Mon Sep 17 00:00:00 2001 From: tophf Date: Mon, 27 Mar 2017 22:45:23 +0300 Subject: [PATCH] fixup f7659343: getStyles is callback-based, not return-based --- background.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/background.js b/background.js index 117d29e3..c0a8908c 100644 --- a/background.js +++ b/background.js @@ -45,13 +45,15 @@ function onBackgroundMessage(request, sender, sendResponse) { switch (request.method) { case 'getStyles': - var styles = getStyles(request, sendResponse); // eslint-disable-line no-var - // check if this is a main content frame style enumeration - if (request.matchUrl && !request.id - && sender && sender.tab && sender.frameId == 0 - && sender.tab.url == request.matchUrl) { - updateIcon(sender.tab, styles); - } + getStyles(request, styles => { + sendResponse(styles); + // check if this is a main content frame style enumeration + if (request.matchUrl && !request.id + && sender && sender.tab && sender.frameId == 0 + && sender.tab.url == request.matchUrl) { + updateIcon(sender.tab, styles); + } + }); return KEEP_CHANNEL_OPEN; case 'saveStyle':