aboutsummaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-03-08 17:34:37 +0100
committerWojtek Kosior <koszko@koszko.org>2022-03-08 17:34:37 +0100
commit093ec2a52697afdda610dde1302a59183719ac0f (patch)
tree1216a20fed8a04b83bdd6ef42f6134c9bddd7a77 /html
parent96efcc335bbd9f2ad098e694d6cff6c1c22b4ce8 (diff)
downloadbrowser-extension-093ec2a52697afdda610dde1302a59183719ac0f.tar.gz
browser-extension-093ec2a52697afdda610dde1302a59183719ac0f.zip
correct the Private Browsing mode notice on settings page
Diffstat (limited to 'html')
-rw-r--r--html/settings.html47
-rw-r--r--html/settings.js19
2 files changed, 29 insertions, 37 deletions
diff --git a/html/settings.html b/html/settings.html
index e33f112..548a39e 100644
--- a/html/settings.html
+++ b/html/settings.html
@@ -35,12 +35,12 @@
#LOADCSS html/base.css
#LOADCSS html/grid.css
<style>
- #loader, #indexeddb_error {
+ .full_page_msg {
margin: auto;
padding: 1em;
max-width: 800px;
}
- #indexeddb_error p {
+ .full_page_msg p {
margin-bottom: 1em;
}
@@ -123,10 +123,12 @@
#INCLUDE html/item_preview.html
#INCLUDE html/text_entry_list.html
#INCLUDE html/payload_create.html
- <div id="loader">
- Loading settings page...
+ <div id="loader" class="full_page_msg">
+ <p>
+ Loading settings page...
+ </p>
</div>
- <div id="indexeddb_error" class="hide">
+ <div id="indexeddb_error" class="hide full_page_msg">
<p>
Cannot display settings page.
</p>
@@ -135,30 +137,21 @@
database in which Haketilo stores all its configuration. Without it, the
settings page is non-operational.
<p>
+ </div>
#IF MOZILLA
- <div id="indexeddb_private_mode_explanation" class="hide">
- <p>
- This issue is the result of using Haketilo in Private Browsing mode.
- For privacy reasons your browser blocks access to IndexedDB in
- private windows and this unfortunately also affects Haketilo's
- settings page.
- </p>
- <p>
- You can sacrifice this single privacy feature and enable IndexedDB
- access in private windows by navigating to "about:config" in the URL
- bar, agreeing to accept the risk and setting the
- "dom.indexedDB.privateBrowsing.enabled" preference to "true". Those
- pages that have their scripts blocked will still be unable to access
- IndexedDB.
- </p>
- <p>
- Alternatively, you can open Haketilo's settings in a separate,
- non-private window. The configuration you make there will take
- effect on pages opened in Private Browsing mode as well.
- </p>
- </div>
-#ENDIF
+ <div id="private_mode_error" class="hide full_page_msg">
+ <p>
+ The settings page could not be displayed in a private window.
+ </p>
+ <p>
+ Due to bug <a href="https://hydrillabugs.koszko.org/issues/115">#115</a>
+ it is currently impossible to access Haketilo settings when in Private
+ Browsing mode. You can instead open this settings page in a non-private
+ window. Changes you make there shall affect websites browsed in Private
+ Mode as well.
+ </p>
</div>
+#ENDIF
<div id="main_view" class="hide">
<ul id="tab_heads">
<li id="blocking_head"> Blocking </li>
diff --git a/html/settings.js b/html/settings.js
index e258fcb..87c1095 100644
--- a/html/settings.js
+++ b/html/settings.js
@@ -134,24 +134,23 @@ function set_up_settings_view() {
set_up_repos_tab();
}
+async function init_settings_page() {
#IF MOZILLA
-async function show_indexeddb_error() {
const this_tab = await browser.tabs.getCurrent();
- if (this_tab.incognito)
- by_id("indexeddb_private_mode_explanation").classList.remove("hide");
-#ELSE
-function show_indexeddb_error() {
+
+ if (this_tab.incognito) {
+ by_id("private_mode_error").classList.remove("hide");
+ by_id("loader").remove();
+ return;
+ }
#ENDIF
- by_id("loader").remove();
- by_id("indexeddb_error").classList.remove("hide");
-}
-async function init_settings_page() {
try {
await haketilodb.get();
} catch(e) {
console.error("Haketilo:", e);
- show_indexeddb_error();
+ by_id("indexeddb_error").classList.remove("hide");
+ by_id("loader").remove();
return;
}