Initial Commit
This commit is contained in:
@@ -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 });
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user