summaryrefslogtreecommitdiff
path: root/html
diff options
context:
space:
mode:
Diffstat (limited to 'html')
-rw-r--r--html/popup.html4
-rw-r--r--html/popup.js23
2 files changed, 21 insertions, 6 deletions
diff --git a/html/popup.html b/html/popup.html
index bb30425..d0a6cb9 100644
--- a/html/popup.html
+++ b/html/popup.html
@@ -70,6 +70,10 @@
#info_form label+span, .top_but_container {
padding-bottom: 0.5em;
}
+
+ #info_form .long_msg {
+ white-space: normal;
+ }
</style>
</head>
<body>
diff --git a/html/popup.js b/html/popup.js
index 532feba..ddc0f51 100644
--- a/html/popup.js
+++ b/html/popup.js
@@ -83,6 +83,8 @@ function show_page_info(page_info) {
if (page_info.payload) {
if ("error" in page_info) {
+ let long_msg = true;
+
if (page_info.error.haketilo_error_type === "missing")
payload_text = `None (error: resource with id '${page_info.error.id}' missing from the database)`;
else if (page_info.error.haketilo_error_type === "circular")
@@ -91,6 +93,11 @@ function show_page_info(page_info) {
payload_text = `None (error: failure reading Haketilo internal database)`;
else if (page_info.error.haketilo_error_type === "other")
payload_text = `None (error: unknown failure occured)`;
+ else
+ long_msg = false;
+
+ if (long_msg)
+ by_id("injected_payload").classList.add("long_msg");
} else {
payload_text = page_info.payload.identifier;
}
@@ -100,19 +107,23 @@ function show_page_info(page_info) {
const scripts_fate = page_info.allow ? "allowed" : "blocked";
- let mapping_text;
+ let mapping_text, long_msg = true;
- if (page_info.mapping === "~allow")
+ if (page_info.mapping === "~allow") {
mapping_text = `None (scripts ${scripts_fate} by a rule)`;
- else if ("error" in page_info
- && page_info.error.haketilo_error_type ==="deciding_policy")
+ } else if ("error" in page_info &&
+ page_info.error.haketilo_error_type === "deciding_policy") {
mapping_text = `None (error occured when determining policy)`;
- else if (page_info.mapping)
+ } else if (page_info.mapping) {
mapping_text = page_info.mapping;
- else
+ long_msg = false;
+ } else {
mapping_text = `None (scripts ${scripts_fate} by default policy)`;
+ }
by_id("mapping_used").innerText = mapping_text;
+ if (long_msg)
+ by_id("mapping_used").classList.add("long_msg");
}
}