From 8cffec6e397ef1dd0932fed143afb53a0da9000d Mon Sep 17 00:00:00 2001 From: stoically Date: Sun, 4 Feb 2018 04:18:42 +0100 Subject: [PATCH] Tweak wording, UI and UX a bit for Deletes History Part of #17 --- options/options.html | 26 +++++++++++++++++--------- src/background/container.js | 12 +++++++++++- src/background/storage.js | 1 + 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/options/options.html b/options/options.html index 34ee92e8..139d0c1c 100644 --- a/options/options.html +++ b/options/options.html @@ -261,20 +261,16 @@

Website Rules

- +
WARNING: EVERY WEBSITE URL that you visit in a "Deletes History Temporary Container" WILL GET DELETED FROM YOUR ENTIRE HISTORY. This means if you visited a Website URL in another Container, Temporary Container or in No Container before or while visiting it in a "Deletes History Temporary Container" - - those visits will get deleted from History too. This is true until Firefox supports a special History for Container Tabs. + then those visits will get deleted from History too. This is true until Firefox supports a special History for Container Tabs. The related Bug can be found here.

- You can open "Deletes History Temporary Containers" with the keyboard shortcut Alt+P instead of configuring it here. The same WARNING applies.
-
- "Deletes History Temporary Containers" will delete history when the "Deletes History Temporary Container" itself gets deleted.
-
Be careful. You have been warned. "Deletes History Temporary Containers" tabs have a "-deletes-history" suffix in the container name to remind you.

@@ -282,12 +278,24 @@

Website Rules

+ When ticking the checkbox Firefox will ask you for "Access browsing history" permissions.
+
+ You can open "Deletes History Temporary Containers" with the keyboard shortcut Alt+P
+
+ The deletion applies to the full Website URL, not only the domain. That means, if you e.g. open a specific reddit post or a news article on + your favorite news site in a "Deletes History Temporary Container" it won't delete all your previous visits to other reddit posts or news articles + that you made outside of "Deletes History Temporary Containers" because the full Website URLs are different.
+
+ "Deletes History Temporary Containers" will delete history when the "Deletes History Temporary Container" itself gets deleted after the last Tab in it closes. +
+
+
+
@@ -295,7 +303,7 @@

Website Rules

diff --git a/src/background/container.js b/src/background/container.js index 78bfa7a0..e1dbaff7 100644 --- a/src/background/container.js +++ b/src/background/container.js @@ -55,7 +55,17 @@ class Container { } let containerName = `${this.storage.local.preferences.containerNamePrefix}${tempContainerNumber}`; if (deletesHistory) { - containerName += '-deletes-history'; + if (!this.storage.local.historyPermission) { + this.storage.local.historyPermission = await browser.permissions.contains({permissions: ['history']}); + if (this.storage.local.historyPermission) { + await this.storage.persist(); + } + } + if (this.storage.local.historyPermission) { + containerName += '-deletes-history'; + } else { + deletesHistory = false; + } } try { let containerColor = this.storage.local.preferences.containerColor; diff --git a/src/background/storage.js b/src/background/storage.js index cc91f7e8..b4469c5c 100644 --- a/src/background/storage.js +++ b/src/background/storage.js @@ -28,6 +28,7 @@ class Storage { containerIconRandom: false, containerNumberMode: 'keep', iconColor: 'default', + historyPermission: false, deletesHistoryContainer: 'never', deletesHistoryContainerMouseClicks: 'never' };