Skip to content

Commit

Permalink
Fix: don't update icon for popup and options
Browse files Browse the repository at this point in the history
  • Loading branch information
eight04 committed Oct 13, 2018
1 parent 01bdd52 commit 14e321d
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions content/apply.js
Expand Up @@ -203,11 +203,13 @@ const APPLY = (() => {
break;

case 'backgroundReady':
initializing.catch(err => {
if (msg.RX_NO_RECEIVER.test(err.message)) {
init();
}
});
initializing
.catch(err => {
if (msg.RX_NO_RECEIVER.test(err.message)) {
return init();
}
})
.catch(console.error);
break;

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

0 comments on commit 14e321d

Please sign in to comment.