From ca6751436b668c3b6bff8225c893d78690e40b23 Mon Sep 17 00:00:00 2001
From: igorlogius <67047467+igorlogius@users.noreply.github.com>
Date: Mon, 29 Jul 2024 16:13:22 +0200
Subject: [PATCH] feat/chore: overhaul options page feat: add 2 extra
multi-open parameters
---
background.js | 27 +++++-
manifest.json | 12 ++-
options.html | 238 +++++++++++++++++++++++++++-----------------------
options.js | 78 +++++++++--------
4 files changed, 206 insertions(+), 149 deletions(-)
diff --git a/background.js b/background.js
index 5bbbd1c..24047ff 100644
--- a/background.js
+++ b/background.js
@@ -7,7 +7,9 @@ let historyCleanUpQueue = [];
let containerCleanupTimer = null;
let toolbarAction = "";
let deldelay = 30000; // delay until Tmp Containers and History Entries are removed
-let multiopen = 3;
+let multiopen = 2;
+let multiopen2 = 3;
+let multiopen3 = 4;
let regexList = null;
let neverOpenInTempContainerRegexList = null;
@@ -249,7 +251,9 @@ async function onStorageChange() {
if (usecolors.length < 1) {
usecolors = allcolors;
}
- multiopen = await getFromStorage("number", "multiopen", 3);
+ multiopen = await getFromStorage("number", "multiopen", 2);
+ multiopen2 = await getFromStorage("number", "multiopen2", 3);
+ multiopen3 = await getFromStorage("number", "multiopen3", 4);
listmode = await getFromStorage("string", "listmode", "include");
@@ -302,11 +306,26 @@ async function onCommand(command) {
}
}
- if (command === "multiopen") {
+ if (command.startsWith("multiopen")) {
+ let repeat = 0;
+
+ switch (command) {
+ case "multiopen":
+ repeat = multiopen;
+ break;
+ case "multiopen2":
+ repeat = multiopen2;
+ break;
+ case "multiopen3":
+ repeat = multiopen3;
+ break;
+ default:
+ return;
+ }
let tabs = await browser.tabs.query({ currentWindow: true, active: true });
if (tabs.length > 0) {
const atab = tabs[0];
- for (let i = 0; i < multiopen; i++) {
+ for (let i = 0; i < repeat; i++) {
createTempContainerTab(atab.url);
}
}
diff --git a/manifest.json b/manifest.json
index 50a4c35..43dc025 100644
--- a/manifest.json
+++ b/manifest.json
@@ -15,7 +15,7 @@
},
"commands": {
"_execute_browser_action": {
- "description": "Toolbar button action"
+ "description": "Toolbar Action"
},
"opennewtab": {
"description": "Open newtab in temp container"
@@ -24,7 +24,13 @@
"description": "Open newtab in same container as current tab"
},
"multiopen": {
- "description": "Multi-Open current tab url in N temp container tabs"
+ "description": "Open current tab URL in X TC tabs"
+ },
+ "multiopen2": {
+ "description": "Open current tab URL in Y TC tabs"
+ },
+ "multiopen3": {
+ "description": "Open current tab URL in Z TC tabs"
}
},
"description": "Open the page,tab,link or bookmark in a new temporary container tab",
@@ -46,5 +52,5 @@
"tabs"
],
"optional_permissions": ["bookmarks", "history"],
- "version": "1.1.38"
+ "version": "1.1.39"
}
diff --git a/options.html b/options.html
index 5d25c47..6cceea0 100644
--- a/options.html
+++ b/options.html
@@ -5,6 +5,7 @@
body {
background-color: lightgrey;
padding: 5px;
+ min-height: 640px;
}
textarea {
width: 100%;
@@ -12,140 +13,163 @@
}
fieldset {
padding: 10px;
- }
- #permissions {
- width: 100%;
- }
-
- #permissions td {
- border-bottom: 1px solid gray;
+ margin: 5px;
+ border: 1px groove black;
}
+
-
-
-