aboutsummaryrefslogtreecommitdiff
path: root/content/main.js
diff options
context:
space:
mode:
Diffstat (limited to 'content/main.js')
-rw-r--r--content/main.js29
1 files changed, 11 insertions, 18 deletions
diff --git a/content/main.js b/content/main.js
index 5a798e0..9e98635 100644
--- a/content/main.js
+++ b/content/main.js
@@ -42,20 +42,12 @@
* proprietary program, I am not going to enforce this in court.
*/
-/*
- * IMPORTS_START
- * IMPORT handle_page_actions
- * IMPORT gen_nonce
- * IMPORT is_privileged_url
- * IMPORT browser
- * IMPORT is_chrome
- * IMPORT is_mozilla
- * IMPORT start_activity_info_server
- * IMPORT make_csp_rule
- * IMPORT csp_header_regex
- * IMPORT report_settings
- * IMPORTS_END
- */
+#IMPORT content/activity_info_server.js
+
+#FROM content/page_actions.js IMPORT handle_page_actions
+#FROM common/misc.js IMPORT gen_nonce, is_privileged_url, \
+ make_csp_rule, csp_header_regex
+#FROM common/browser.js IMPORT browser
document.content_loaded = document.readyState === "complete";
const wait_loaded = e => e.content_loaded ? Promise.resolve() :
@@ -234,12 +226,13 @@ function mozilla_initial_block(doc)
*/
async function sanitize_document(doc, policy)
{
+#IF MOZILLA
/*
* Blocking of scripts that are in the DOM from the beginning. Needed for
* Mozilla.
*/
- if (is_mozilla)
- mozilla_initial_block(doc);
+ mozilla_initial_block(doc);
+#ENDIF
/*
* Ensure our CSP rules are employed from the beginning. This CSP injection
@@ -338,7 +331,7 @@ if (!is_privileged_url(document.URL)) {
console.debug("current policy", policy);
- report_settings(policy);
+ activity_info_server.report_settings(policy);
policy.nonce = gen_nonce();
@@ -350,5 +343,5 @@ if (!is_privileged_url(document.URL)) {
handle_page_actions(policy, doc_ready);
- start_activity_info_server();
+ activity_info_server.start();
}