Skip to content

Commit

Permalink
fix hash
Browse files Browse the repository at this point in the history
  • Loading branch information
39zde committed Oct 28, 2024
1 parent 37fbfbb commit 840b620
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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("<!doctype html>\n" + html).buffer, "text/html", "simple-file-compressor");
}
Expand Down

0 comments on commit 840b620

Please sign in to comment.