aboutsummaryrefslogtreecommitdiff
path: root/content/page_actions.js
diff options
context:
space:
mode:
authorjahoti <jahoti@tilde.team>2021-09-21 00:00:00 +0000
committerjahoti <jahoti@tilde.team>2021-09-21 00:00:00 +0000
commit59fb32a341d42c685b5167c3d8b4d7b87c49fd18 (patch)
tree17143cd40a59eb06b4e698d6fd9ca9d02abaf2b9 /content/page_actions.js
parentb1444d9c9ea065d7c97d5809c3ec5259cb01a1da (diff)
parent960363e7dd98a724246320e49c3fbaff9d68d1bd (diff)
downloadbrowser-extension-59fb32a341d42c685b5167c3d8b4d7b87c49fd18.tar.gz
browser-extension-59fb32a341d42c685b5167c3d8b4d7b87c49fd18.zip
Merge branch 'master' into jahoti-update
Diffstat (limited to 'content/page_actions.js')
-rw-r--r--content/page_actions.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/content/page_actions.js b/content/page_actions.js
index 8057541..db7c352 100644
--- a/content/page_actions.js
+++ b/content/page_actions.js
@@ -1,5 +1,7 @@
/**
- * Hachette handling of page actions in content scripts
+ * This file is part of Haketilo.
+ *
+ * Function: Handle page actions in a content script.
*
* Copyright (C) 2021 Wojtek Kosior
* Redistribution terms are gathered in the `copyright' file.
@@ -11,7 +13,7 @@
* IMPORT browser
* IMPORT report_script
* IMPORT report_settings
- * IMPORT report_content_type
+ * IMPORT report_document_type
* IMPORTS_END
*/
@@ -60,7 +62,7 @@ function add_script(script_text)
let script = document.createElement("script");
script.textContent = script_text;
script.setAttribute("nonce", nonce);
- script._hachette_payload = true;
+ script.haketilo_payload = true;
document.body.appendChild(script);
report_script(script_text);
@@ -70,8 +72,8 @@ function handle_page_actions(script_nonce, policy_received_cb,
doc_ready_promise) {
policy_received_callback = policy_received_cb;
url = document.URL;
- is_html = /html/.test(document.contentType);
- report_content_type(document.contentType);
+ is_html = document instanceof HTMLDocument;
+ report_document_type(is_html);
doc_ready_promise.then(document_ready);