Skip to content

Instantly share code, notes, and snippets.

@54keesh
Created August 18, 2026 10:02
Show Gist options
  • Select an option

  • Save 54keesh/f6a0f7b29080b091849d25db68b98280 to your computer and use it in GitHub Desktop.

Select an option

Save 54keesh/f6a0f7b29080b091849d25db68b98280 to your computer and use it in GitHub Desktop.
This gist is for mute/unmute tabs incase the official chrome extension goes down again
async function toggleMuteState(tabId) {
try {
const tab = await chrome.tabs.get(tabId);
const muted = !tab.mutedInfo.muted;
await chrome.tabs.update(tabId, { muted });
} catch (err) {
console.error("Failed to toggle mute:", err);
}
}
chrome.commands.onCommand.addListener(async (command) => {
if (command === "toggle-mute") {
try {
const [tab] = await chrome.tabs.query({ active: true, currentWindow: true });
if (tab) {
await toggleMuteState(tab.id);
}
} catch (err) {
console.error("Failed to query active tab:", err);
}
}
});
chrome.action.onClicked.addListener(async (tab) => {
chrome.tabs.create({
url: "help/index.html"
})
});
chrome.runtime.onInstalled.addListener(({ reason }) => {
if (reason === "install") {
chrome.tabs.create({
url: "https://browsernative.com/mute-tab-keyboard-shortcut-chrome-extension/"
})
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment