Created
January 20, 2020 09:30
-
-
Save hustKiwi/ef4e8a7bb88bc53cb805daf9cf71b680 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chrome.onMessage.onClicked.addListener(message => { | |
if (message === 'some action') { | |
chrome.tabs.query( | |
{ | |
active: true, | |
currentWindow: true, | |
}, | |
tabs => { | |
const activeTab = tabs[0]; | |
chrome.tabs.executeScript(activeTab.id, { | |
code: 'your js script', | |
}); | |
}, | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment