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 => {
sendResponse(styles);
// check if this is a main content frame style enumeration // check if this is a main content frame style enumeration
if (request.matchUrl && !request.id if (request.matchUrl && !request.id
&& sender && sender.tab && sender.frameId == 0 && sender && sender.tab && sender.frameId == 0
&& sender.tab.url == request.matchUrl) { && sender.tab.url == request.matchUrl) {
updateIcon(sender.tab, styles); updateIcon(sender.tab, styles);
} }
});
return KEEP_CHANNEL_OPEN; return KEEP_CHANNEL_OPEN;
case 'saveStyle': case 'saveStyle':