Created
April 4, 2024 10:38
-
-
Save smitmartijn/77c52eb47c9fb8dd5b83216c1f2064f8 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.runtime.onMessage.addListener(function (message, sender, sendResponse) { | |
if (message.action === "googleMeetBringToFront") { | |
chrome.tabs.query({}, function (tabs) { | |
let meetFound = false; | |
for (let i = 0; i < tabs.length; i++) { | |
if (tabs[i].url.includes('meet.google.com')) { | |
meetFound = true; | |
chrome.tabs.update(tabs[i].id, { selected: true }); | |
chrome.windows.update(tabs[i].windowId, { focused: true }); | |
break; | |
} | |
} | |
if (!meetFound) { | |
console.log('No Google Meet tabs found'); | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The reason why MuteDeck's Google Chrome extension needs the "tabs" permissions, which is labeled as "Browsing History" in Chrome (awkwardly named).