From c4ed1b8d44c37938aaa9b12674077274554742eb Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Thu, 13 May 2021 12:32:22 +0200 Subject: utilize CSP for blocking --- content/main.js | 32 ++++++++++++++++++++++++++++---- content/page_actions.js | 6 +++++- 2 files changed, 33 insertions(+), 5 deletions(-) (limited to 'content') diff --git a/content/main.js b/content/main.js index c7f57bb..507a740 100644 --- a/content/main.js +++ b/content/main.js @@ -25,6 +25,8 @@ let url = url_item(document.URL); let unique = gen_unique(url); + let nonce = unique.substring(1); + var block = true; if (first_target !== undefined && first_target === unique) { @@ -47,10 +49,20 @@ } for (let mutation of mutations) { for (let node of mutation.addedNodes) { - if (node.tagName === "SCRIPT") + /* + * Modifying