diff options
author | V <v@anomalous.eu> | 2021-07-31 03:37:47 +0200 |
---|---|---|
committer | V <v@anomalous.eu> | 2021-07-31 03:37:47 +0200 |
commit | 32e91464189b7e5458eb698616025adbb05b5eab (patch) | |
tree | 88e871c22c2c0889fae38e7399b1b8a428b641b8 | |
parent | 3ef33c8380d8572ddd6161c9be5c3b8b9bf1e778 (diff) | |
download | email-protected-32e91464189b7e5458eb698616025adbb05b5eab.tar.zst |
My girlfriend is incorrigible
-rw-r--r-- | content.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/content.js b/content.js index 1ea1429..5f1d36a 100644 --- a/content.js +++ b/content.js @@ -10,7 +10,7 @@ function decodeHtml(str) { return doc.documentElement.textContent } -// decodes an obfuscated e-mail +// decodes an obfuscated e-mail address function decode(data) { const [key, ...encoded] = data.match(/.{2}/g).map(e => parseInt(e, 16)) const bytes = encoded.map(e => String.fromCharCode(e ^ key)).join('') @@ -19,7 +19,7 @@ function decode(data) { return decodeHtml(decodeUtf8(bytes)) } -// processes a document fragment for obfuscated e-mails +// processes a document fragment for obfuscated e-mail addresses function process(root) { // mailto links // format: <a href="/cdn-cgi/l/email-protection#{obfuscated data}">...</a> @@ -33,7 +33,7 @@ function process(root) { } } - // everything else Cloudflare thinks is an e-mail + // everything else Cloudflare thinks is an e-mail address // format: <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="{obfuscated data}">[email protected]</a> for (const node of root.querySelectorAll('.__cf_email__')) node.replaceWith(decode(node.getAttribute('data-cfemail'))) |