extension-section-1-background-2
chrome.runtime.onConnect.addListener(port => { | |
const tabId = port && port.sender && port.sender.tab.id | |
if (port.name === 'hello') { | |
enableIcon(tabId) | |
} | |
// disable icon when connection is closed | |
port.onDisconnect.addListener(() => { | |
disableIcon(tabId) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment