Fix: don't update icon for popup and options

This commit is contained in:
eight 2018-10-14 00:40:23 +08:00
parent 01bdd529bc
commit 14e321d258

View File

@ -203,11 +203,13 @@ const APPLY = (() => {
break; break;
case 'backgroundReady': case 'backgroundReady':
initializing.catch(err => { initializing
if (msg.RX_NO_RECEIVER.test(err.message)) { .catch(err => {
init(); if (msg.RX_NO_RECEIVER.test(err.message)) {
} return init();
}); }
})
.catch(console.error);
break; break;
case 'updateCount': case 'updateCount':
@ -258,8 +260,12 @@ const APPLY = (() => {
// we don't care about iframes // we don't care about iframes
return; return;
} }
if (/^\w+?-extension:\/\/.+(popup|options)\.html$/.test(location.href)) {
// popup and the option page are not tabs
return;
}
if (STYLE_VIA_API) { if (STYLE_VIA_API) {
API.styleViaAPI({method: 'updateCount'}); API.styleViaAPI({method: 'updateCount'}).catch(msg.ignoreError);
return; return;
} }
let count = 0; let count = 0;