Skip to content

Instantly share code, notes, and snippets.

@fjaguero
Created July 14, 2017 08:03
Show Gist options
  • Save fjaguero/8b86165f0f5ad838af46c6c698535bb7 to your computer and use it in GitHub Desktop.
Save fjaguero/8b86165f0f5ad838af46c6c698535bb7 to your computer and use it in GitHub Desktop.
Background
// Listen to content.js events
chrome.extension.onMessage.addListener(
function(request, sender, sendResponse) {
if (request.count || request.count === 0) {
chrome.browserAction.setBadgeText({'text': request.count.toString()})
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment