From c95f3725d2986f4a691f1a2d224a090795dffd5d Mon Sep 17 00:00:00 2001 From: OlivierChiasson Date: Fri, 17 Jul 2026 15:05:16 -0300 Subject: [PATCH] Initial Commit --- background.js | 10 ++++++++++ manifest.json | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 background.js create mode 100644 manifest.json diff --git a/background.js b/background.js new file mode 100644 index 0000000..9bdc027 --- /dev/null +++ b/background.js @@ -0,0 +1,10 @@ +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 }); + }); + } +}); \ No newline at end of file diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..9c3dded --- /dev/null +++ b/manifest.json @@ -0,0 +1,20 @@ +{ + "manifest_version": 3, + "name": "CtrlMute", + "version": "1.0", + "description": "A basic toggle mute extension.", + "permissions": [ + "tabs" + ], + "background": { + "service_worker": "background.js" + }, + "commands": { + "toggle-mute": { + "suggested_key": { + "default": "Ctrl+M" + }, + "description": "Toggle mute for the current tab" + } + } +}