From 840b62036056547ba4687095c3b433af6d1f016d Mon Sep 17 00:00:00 2001 From: 39zde Date: Mon, 28 Oct 2024 09:38:44 +0100 Subject: [PATCH] fix hash --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index f80c72a..f7e1fb8 100644 --- a/index.js +++ b/index.js @@ -366,6 +366,9 @@ async function saveHtmlFile() { } } + // don't show the html download option + css = css.replace(/(?<=\#save-html-notice[\s]{0,}\{\n[\s]{0,}display:[\s]{0,})inline/gm, "none"); + for (let link of document.querySelectorAll("link")) { if (link.rel !== "stylesheet") { // remove any link, which is not the stylesheet one @@ -385,8 +388,6 @@ async function saveHtmlFile() { html = html.replace("script-src 'self'", `script-src 'sha256-${jsHash}'`); // remove the base tag html = html.replace(document.querySelector("base").outerHTML, ""); - // don't show the html download option - html = html.replace( /(?<=\#save-html-notice[\s]{0,}\{\n[\s]{0,}display:[\s]{0,})inline/gm,"none"); downloadFile(encoder.encode("\n" + html).buffer, "text/html", "simple-file-compressor"); }