From 1f22454b7fcefe1f5790eb797dd13cd59ed06cef Mon Sep 17 00:00:00 2001 From: Franco Serio Date: Mon, 27 Jan 2025 19:34:14 +0100 Subject: [PATCH 1/4] feat: first iteration of close non-pinned tabs --- background.js | 10 ++++++++++ popup.js | 3 +++ 2 files changed, 13 insertions(+) diff --git a/background.js b/background.js index 2407dea..e14fabd 100644 --- a/background.js +++ b/background.js @@ -15,6 +15,13 @@ async function toggle_muted_state_tab() { await chrome.tabs.update(currentTab.id, { muted }) } +async function close_all_except_fixed_tabs() { + const allTabs = await chrome.tabs.query({ lastFocusedWindow: true }); + const nonPinnedTabs = allTabs.filter(tab => !tab.pinned).map(tab => tab.id) + + await chrome.tabs.remove(nonPinnedTabs); +} + async function close_duplicated_tabs() { const allTabs = await chrome.tabs.query({ lastFocusedWindow: true }); const uniqUrls = new Set(allTabs.map(tab => tab.url)); @@ -146,6 +153,9 @@ chrome.commands.onCommand.addListener(async (command) => { case 'toggle_muted_state_tab': await toggle_muted_state_tab(); break; + case 'close_all_except_fixed_tabs': + await close_all_except_fixed_tabs(); + break; } }); diff --git a/popup.js b/popup.js index 8002669..499b951 100644 --- a/popup.js +++ b/popup.js @@ -5,16 +5,19 @@ window.onload = async function() { const go_to_next_tab_command = allCommands.find(command => command.name === "go_to_next_tab"); const go_to_previous_tab_command = allCommands.find(command => command.name === "go_to_previous_tab"); const toggle_muted_state_tab = allCommands.find(command => command.name === "toggle_muted_state_tab"); + const close_all_tabs_except_fixed = allCommands.find(command => command.name === "close_non_fixed_tabs"); document.getElementById('close-all-except-current-command').textContent = close_all_tabs_except_current_command.shortcut; document.getElementById('close-duplicated-command').textContent = close_duplicated_tabs_command.shortcut; document.getElementById('go-to-next-tab-command').textContent = go_to_next_tab_command.shortcut; document.getElementById('go-to-previous-tab-command').textContent = go_to_previous_tab_command.shortcut; document.getElementById('toggle-muted-state-tab-command').textContent = toggle_muted_state_tab.shortcut; + document.getElementById('close-non-fixed-command').textContent = close_all_tabs_except_fixed.shortcut; document.getElementById('close-all-except-current-description').textContent = close_all_tabs_except_current_command.description; document.getElementById('close-duplicated-description').textContent = close_duplicated_tabs_command.description; document.getElementById('go-to-next-tab-description').textContent = go_to_next_tab_command.description; document.getElementById('go-to-previous-tab-description').textContent = go_to_previous_tab_command.description; document.getElementById('toggle-muted-state-tab-description').textContent = toggle_muted_state_tab.description; + document.getElementById('close-all-except-fixed-description').textContent = close_all_tabs_except_fixed.description; } From 97bf789634e85e109c5a5e390ceaf2f7cf2c9c2c Mon Sep 17 00:00:00 2001 From: Franco Serio Date: Mon, 27 Jan 2025 19:41:55 +0100 Subject: [PATCH 2/4] chore: update version in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 96c73b0..be3a508 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "samext", - "version": "1.0.5", + "version": "1.2.2", "private": true, "description": "This is an extension for Chrome and Brave that enables you to manage your tabs with ease", "main": "background.js", From 47aace640f823570a3337fd9681b5c670e210bb9 Mon Sep 17 00:00:00 2001 From: Franco Serio Date: Mon, 27 Jan 2025 22:13:32 +0100 Subject: [PATCH 3/4] fix: fix Aragorn --- README.md | 1 + manifest.json | 5 ++++- package.json | 2 +- popup.html | 4 ++++ popup.js | 12 ++++++------ 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7f93954..8658a70 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,7 @@ - Go to previous tab with Alt+Shift+P (Opt+Shift+P in Mac) - Go to next tab with Alt+Shift+N (Opt+Shift+N in Mac) - Mute/Unmute current tab (you need to map the shortcut yourself. We recommend Alt+Shift+M or Opt+Shift+M in Mac) +- Close all tabs not pinned/fixed (you need to map the shortcut yourself. We recommend Alt+Shift+F or Opt+Shift+F in Mac) ##### UPCOMING FEATURES: - Switch tab based on content search. diff --git a/manifest.json b/manifest.json index dce124a..abe55a2 100644 --- a/manifest.json +++ b/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 3, "name": "samext", - "version": "1.2.1", + "version": "1.2.3", "description": "Samser Tab Manager Extension - Manage your tabs easily", "author": "franco@samser.co", "icons": { @@ -19,6 +19,9 @@ "default_popup": "popup.html" }, "commands": { + "close_all_except_fixed_tabs": { + "description": "Close all except pinned/fixed" + }, "toggle_muted_state_tab": { "description": "Mute/unmute current tab" }, diff --git a/package.json b/package.json index be3a508..3c5385a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "samext", - "version": "1.2.2", + "version": "1.2.3", "private": true, "description": "This is an extension for Chrome and Brave that enables you to manage your tabs with ease", "main": "background.js", diff --git a/popup.html b/popup.html index d1ed83c..801b484 100644 --- a/popup.html +++ b/popup.html @@ -29,6 +29,10 @@

Shortcuts

+
+ + +
diff --git a/popup.js b/popup.js index 499b951..b5e5e7f 100644 --- a/popup.js +++ b/popup.js @@ -4,20 +4,20 @@ window.onload = async function() { const close_duplicated_tabs_command = allCommands.find(command => command.name === "close_duplicated_tabs"); const go_to_next_tab_command = allCommands.find(command => command.name === "go_to_next_tab"); const go_to_previous_tab_command = allCommands.find(command => command.name === "go_to_previous_tab"); - const toggle_muted_state_tab = allCommands.find(command => command.name === "toggle_muted_state_tab"); - const close_all_tabs_except_fixed = allCommands.find(command => command.name === "close_non_fixed_tabs"); + const toggle_muted_state_tab_command = allCommands.find(command => command.name === "toggle_muted_state_tab"); + const close_all_tabs_except_fixed_command = allCommands.find(command => command.name === "close_all_except_fixed_tabs"); document.getElementById('close-all-except-current-command').textContent = close_all_tabs_except_current_command.shortcut; document.getElementById('close-duplicated-command').textContent = close_duplicated_tabs_command.shortcut; document.getElementById('go-to-next-tab-command').textContent = go_to_next_tab_command.shortcut; document.getElementById('go-to-previous-tab-command').textContent = go_to_previous_tab_command.shortcut; - document.getElementById('toggle-muted-state-tab-command').textContent = toggle_muted_state_tab.shortcut; - document.getElementById('close-non-fixed-command').textContent = close_all_tabs_except_fixed.shortcut; + document.getElementById('toggle-muted-state-tab-command').textContent = toggle_muted_state_tab_command.shortcut; + document.getElementById('close-all-except-fixed-command').textContent = close_all_tabs_except_fixed_command.shortcut; document.getElementById('close-all-except-current-description').textContent = close_all_tabs_except_current_command.description; document.getElementById('close-duplicated-description').textContent = close_duplicated_tabs_command.description; document.getElementById('go-to-next-tab-description').textContent = go_to_next_tab_command.description; document.getElementById('go-to-previous-tab-description').textContent = go_to_previous_tab_command.description; - document.getElementById('toggle-muted-state-tab-description').textContent = toggle_muted_state_tab.description; - document.getElementById('close-all-except-fixed-description').textContent = close_all_tabs_except_fixed.description; + document.getElementById('toggle-muted-state-tab-description').textContent = toggle_muted_state_tab_command.description; + document.getElementById('close-all-except-fixed-description').textContent = close_all_tabs_except_fixed_command.description; } From 14a8f338b316697e2f24397d45918d9fcff1f525 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Mon, 27 Jan 2025 21:31:23 +0000 Subject: [PATCH 4/4] chore(release): 1.3.0 [skip ci] # [1.3.0](https://github.com/tanoargie/samext/compare/v1.2.1...v1.3.0) (2025-01-27) ### Bug Fixes * fix Aragorn ([47aace6](https://github.com/tanoargie/samext/commit/47aace640f823570a3337fd9681b5c670e210bb9)) ### Features * first iteration of close non-pinned tabs ([1f22454](https://github.com/tanoargie/samext/commit/1f22454b7fcefe1f5790eb797dd13cd59ed06cef)) --- samext.zip | Bin 6410 -> 6511 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/samext.zip b/samext.zip index a1b13fc349248935f55cd37fc0e6bafb5234801a..adcddb9a84f64271d2167b0d01b1db55358f0a9b 100644 GIT binary patch delta 3031 zcma)8c|6p67yb>CEJL;|Gee9pmN0h7PD7Fi*&?}?$t+^*%M@iA(Z$%3ElVUN8JFBa zOyge4no^`sma?QKAtiE0-S^|VuY2G3kMsNMcb?Dpobx>AImwzVP0~?YPOvBd0NlXT zO+)v5R`ftS2mo5a0KgBx0h|vWR13U2SA6_=21FtRna~tC zG&!d_Fdb<++L>O@1UtH^_*BTI&2xL)^j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