chrome.commands.onCommand.addListener((command) => { if (command === "toggle-mute") { chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => { if (!tabs || !tabs[0]) return const tab = tabs[0]; const isMuted = tab.mutedInfo ? tab.mutedInfo.muted : false; chrome.tabs.update(tab.id, { muted: !isMuted }); }); } });