Skip to content

Instantly share code, notes, and snippets.

@jessuni
Last active August 24, 2020 11:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jessuni/f152c169a000372446f39d13efab1eb3 to your computer and use it in GitHub Desktop.
Save jessuni/f152c169a000372446f39d13efab1eb3 to your computer and use it in GitHub Desktop.
extension-section-1-background-1
function disableIcon(tabId) {
chrome.browserAction.setIcon({
tabId: tabId,
path: {
'16': '/images/icon16-gray.png',
'32': '/images/icon32-gray.png',
},
})
chrome.browserAction.setPopup({
tabId,
popup: '',
})
}
function enableIcon(tabId) {
chrome.browserAction.setIcon({
tabId: tabId,
path: {
'16': '/images/icon16.png',
'32': '/images/icon32.png',
},
})
chrome.browserAction.setPopup({
tabId,
popup: 'popup.html',
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment