Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hindmost/08ee4505a1ee6d6f51138830119c5dcc to your computer and use it in GitHub Desktop.
Save hindmost/08ee4505a1ee6d6f51138830119c5dcc to your computer and use it in GitHub Desktop.
cra-rich-chrome-ext article: src/content.js - modifications
...
(async () => {
chrome.runtime.onMessage.addListener( data => {
// if current tab received focus, apply mark/unmark operations (if any),
// then, if there was no mark operation, update marker stats
data && data.id === 'tabFocusPass' &&
!render(store) && updateStats(store);
});
...
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment