Created
December 22, 2016 16:52
-
-
Save groovecoder/9c5435b6fa30589cad3d7f637f5f2202 to your computer and use it in GitHub Desktop.
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
| document.querySelector('#sort-containers-link').addEventListener('click', ()=> { | |
| const sortedTabsArray = []; | |
| browser.contextualIdentities.query({}).then(identities=> { | |
| identities.unshift({cookieStoreId: 'firefox-default'}); | |
| console.log('identities: ', identities); | |
| const tabsArray = browser.tabs.query({}).then(tabsArray); | |
| identities.forEach(identity=> { | |
| tabsArray.forEach(tab=> { | |
| if (tab.cookieStoreId === identity.cookieStoreId) { | |
| sortedTabsArray.push(tab.id); | |
| } | |
| }); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment