allow to mute and unmute tabs and get mute status into tab info
Testing / test (push) Failing after 34s

This commit is contained in:
2026-04-13 21:19:27 +02:00
parent 5150933319
commit c494e76fe2
7 changed files with 84 additions and 3 deletions
+22 -1
View File
@@ -141,6 +141,8 @@ async function dispatch(command, args) {
case "tabs.dedupe": return tabsDedupe();
case "tabs.sort": return tabsSort(args);
case "tabs.merge_windows": return tabsMergeWindows();
case "tabs.mute": return tabsMute(args);
case "tabs.unmute": return tabsUnmute(args);
// ── Groups ────────────────────────────────────────────────────────────
case "group.list": return groupList();
@@ -439,8 +441,27 @@ async function tabsMergeWindows() {
return { moved };
}
async function tabsMute({ tabId }) {
const tab = tabId ? await chrome.tabs.get(tabId) : await getActiveTab();
await chrome.tabs.update(tab.id, { muted: true });
return { tabId: tab.id, muted: true };
}
async function tabsUnmute({ tabId }) {
const tab = tabId ? await chrome.tabs.get(tabId) : await getActiveTab();
await chrome.tabs.update(tab.id, { muted: false });
return { tabId: tab.id, muted: false };
}
function tabInfo(t) {
return { id: t.id, windowId: t.windowId, active: t.active, title: t.title, url: t.url };
return {
id: t.id,
windowId: t.windowId,
active: t.active,
muted: Boolean(t.mutedInfo && t.mutedInfo.muted),
title: t.title,
url: t.url,
};
}
// ── Groups ────────────────────────────────────────────────────────────────────
+1 -1
View File
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "browser-cli",
"version": "0.5.8",
"version": "0.5.10",
"description": "Control your browser from the terminal via browser-cli",
"permissions": [
"tabs",