diff options
author | jahoti <jahoti@tilde.team> | 2021-09-21 00:00:00 +0000 |
---|---|---|
committer | jahoti <jahoti@tilde.team> | 2021-09-21 00:00:00 +0000 |
commit | 59fb32a341d42c685b5167c3d8b4d7b87c49fd18 (patch) | |
tree | 17143cd40a59eb06b4e698d6fd9ca9d02abaf2b9 /background/stream_filter.js | |
parent | b1444d9c9ea065d7c97d5809c3ec5259cb01a1da (diff) | |
parent | 960363e7dd98a724246320e49c3fbaff9d68d1bd (diff) | |
download | browser-extension-59fb32a341d42c685b5167c3d8b4d7b87c49fd18.tar.gz browser-extension-59fb32a341d42c685b5167c3d8b4d7b87c49fd18.zip |
Merge branch 'master' into jahoti-update
Diffstat (limited to 'background/stream_filter.js')
-rw-r--r-- | background/stream_filter.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/background/stream_filter.js b/background/stream_filter.js index 96b6132..e5e0827 100644 --- a/background/stream_filter.js +++ b/background/stream_filter.js @@ -1,5 +1,7 @@ /** - * Hachette modifying a web page using the StreamFilter API + * This file is part of Haketilo. + * + * Function: Modifying a web page using the StreamFilter API. * * Copyright (C) 2018 Giorgio Maone <giorgio@maone.net> * Copyright (C) 2021 Wojtek Kosior @@ -12,7 +14,7 @@ /* * IMPORTS_START * IMPORT browser - * IMPORT is_csp_header_name + * IMPORT csp_header_regex * IMPORTS_END */ @@ -116,8 +118,7 @@ function may_define_csp_rules(html) const doc = new DOMParser().parseFromString(html, "text/html"); for (const meta of doc.querySelectorAll("head>meta[http-equiv]")) { - if (is_csp_header_name(meta.getAttribute("http-equiv"), true) && - meta.content) + if (csp_header_regex.test(meta.httpEquiv) && meta.content) return true; } @@ -174,7 +175,7 @@ function filter_data(properties, event) */ const dummy_script = - `<script data-hachette-deleteme="${properties.policy.nonce}" nonce="${properties.policy.nonce}">null</script>`; + `<script data-haketilo-deleteme="${properties.policy.nonce}" nonce="${properties.policy.nonce}">null</script>`; const doctype_decl = /^(\s*<!doctype[^<>"']*>)?/i.exec(decoded)[0]; decoded = doctype_decl + dummy_script + decoded.substring(doctype_decl.length); |