aboutsummaryrefslogtreecommitdiff
path: root/html/repo_query.js
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-03-08 18:15:23 +0100
committerWojtek Kosior <koszko@koszko.org>2022-03-10 11:43:51 +0100
commit003876d507112ebe2575086514d5a388f78dedd9 (patch)
tree58cc0e5f119df559377dbff830d140110eca35a0 /html/repo_query.js
parent093ec2a52697afdda610dde1302a59183719ac0f (diff)
downloadbrowser-extension-003876d507112ebe2575086514d5a388f78dedd9.tar.gz
browser-extension-003876d507112ebe2575086514d5a388f78dedd9.zip
present appropriate error message when using popup in Private Browsing mode
Diffstat (limited to 'html/repo_query.js')
-rw-r--r--html/repo_query.js22
1 files changed, 19 insertions, 3 deletions
diff --git a/html/repo_query.js b/html/repo_query.js
index 7cfd6fe..601a0aa 100644
--- a/html/repo_query.js
+++ b/html/repo_query.js
@@ -160,11 +160,20 @@ function RepoEntry(query_view, repo_url) {
const container_ids = ["repos_list_container", "install_view_container"];
-function RepoQueryView(tab_id, on_view_show, on_view_hide) {
+function RepoQueryView(tab, on_view_show, on_view_hide) {
Showable.call(this, on_view_show, on_view_hide);
Object.assign(this, clone_template("repo_query"));
- this.tab_id = tab_id;
+ this.tab_id = tab.id;
+#IF MOZILLA
+ this.incognito = tab.incognito;
+ if (this.incognito) {
+ [...this.top_text.childNodes].forEach(n => n.remove());
+ this.top_text.append(
+ clone_template("repo_query_private_mode_error").main_span
+ );
+ }
+#ENDIF
const show_container = name => {
for (const cid of container_ids) {
@@ -175,7 +184,7 @@ function RepoQueryView(tab_id, on_view_show, on_view_hide) {
}
this.install_view = new InstallView(
- tab_id,
+ this.tab_id,
() => show_container("install_view_container"),
() => show_container("repos_list_container")
);
@@ -186,6 +195,13 @@ function RepoQueryView(tab_id, on_view_show, on_view_hide) {
if (!show_super())
return;
+#IF MOZILLA
+ if (this.incognito) {
+ this.repo_entries = [];
+ return;
+ }
+#ENDIF
+
this.url = url;
this.url_span.innerText = url;