diff options
Diffstat (limited to 'content/page_actions.js')
-rw-r--r-- | content/page_actions.js | 12 |
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); |