Created
September 16, 2018 23:32
-
-
Save nickytonline/2c98f1ee4cf17f04a275b642b17c0683 to your computer and use it in GitHub Desktop.
Chrome Extension Snippets
This file contains hidden or 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
function getActiveTab() { | |
return new Promise((resolve, reject) => { | |
chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) { | |
const activeTab = tabs.find(t => t.active); | |
resolve(activeTab); | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment