fixup f7659343: getStyles is callback-based, not return-based

This commit is contained in:
tophf 2017-03-27 22:45:23 +03:00
parent 64c830caa9
commit 4be9dc0413

View File

@ -45,13 +45,15 @@ function onBackgroundMessage(request, sender, sendResponse) {
switch (request.method) { switch (request.method) {
case 'getStyles': case 'getStyles':
var styles = getStyles(request, sendResponse); // eslint-disable-line no-var getStyles(request, styles => {
// check if this is a main content frame style enumeration sendResponse(styles);
if (request.matchUrl && !request.id // check if this is a main content frame style enumeration
&& sender && sender.tab && sender.frameId == 0 if (request.matchUrl && !request.id
&& sender.tab.url == request.matchUrl) { && sender && sender.tab && sender.frameId == 0
updateIcon(sender.tab, styles); && sender.tab.url == request.matchUrl) {
} updateIcon(sender.tab, styles);
}
});
return KEEP_CHANNEL_OPEN; return KEEP_CHANNEL_OPEN;
case 'saveStyle': case 'saveStyle':