diff options
author | V <v@anomalous.eu> | 2020-08-14 23:52:07 +0200 |
---|---|---|
committer | V <v@anomalous.eu> | 2020-08-14 23:52:07 +0200 |
commit | c8066e03c67cab112f91b24e4416aefec33cf2bc (patch) | |
tree | fc1c14271ae0044a4e95ef320bccb6cdd9b5f126 | |
parent | fb021e2cf43da42bfef11ebaa781388f1bb7613f (diff) | |
download | email-protected-c8066e03c67cab112f91b24e4416aefec33cf2bc.tar.zst |
let -> const
-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) |