diff options
-rw-r--r-- | content.js | 6 |
1 files changed, 3 insertions, 3 deletions
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: <script data-cfasync="false" src="/cdn-cgi/scripts/71a88165/cloudflare-static/email-decode.min.js"></script> // (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) |