Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function getAllTabs() {
- return new Promise(resolve => chrome.windows.getAll({populate: true}, windows => {
- const allTabs = windows.flatMap(window => window.tabs.map(tab => {
- let url = new URL(tab.url);
- return {windowId: window.id.toString(), tabId: tab.id.toString(), domain: url.hostname, title: tab.title, url: tab.url};
- }));
- resolve(allTabs);
- }));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement