From c8066e03c67cab112f91b24e4416aefec33cf2bc Mon Sep 17 00:00:00 2001 From: V Date: Fri, 14 Aug 2020 23:52:07 +0200 Subject: let -> const --- content.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'content.js') diff --git a/content.js b/content.js index 2329ae5..72ddcc4 100644 --- a/content.js +++ b/content.js @@ -6,14 +6,14 @@ function decodeUtf8(str) { // decodes a string containing HTML entities function decodeHtml(str) { - let doc = new DOMParser().parseFromString(str, 'text/html') + const doc = new DOMParser().parseFromString(str, 'text/html') return doc.documentElement.textContent } // decodes a "protected" "email" function decode(data) { const [key, ...encoded] = data.match(/.{2}/g).map(e => parseInt(e, 16)) - let bytes = encoded.map(e => String.fromCharCode(e ^ key)).join("") + const bytes = encoded.map(e => String.fromCharCode(e ^ key)).join("") // not sure why the proprietary code decodes entities, but I'm not changing it return decodeHtml(decodeUtf8(bytes)) @@ -45,7 +45,7 @@ function process(root) { // it doesn't make sense to run our stuff if this isn't in the page // format: // (the hexadecimal part can change) -let scripts = document.querySelectorAll('script[src$="/cloudflare-static/email-decode.min.js"]') +const scripts = document.querySelectorAll('script[src$="/cloudflare-static/email-decode.min.js"]') if (scripts !== null) { scripts.forEach(e => e.remove()) process(document) -- cgit 1.4.1