From a35043bcaf986fef371db734c8e5f0271a7291c2 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Tue, 30 Apr 2024 18:59:57 -0700 Subject: [PATCH] Inject email into HTML pages Replaces Cloudflare's email-decode.min.js --- errors/404.html | 9 +++++++-- index.html | 2 +- script.js | 5 +++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/errors/404.html b/errors/404.html index 65a69db..dbe6904 100644 --- a/errors/404.html +++ b/errors/404.html @@ -61,10 +61,10 @@
- + @@ -80,6 +80,11 @@ document.querySelector('div').remove(); message.removeAttribute('hidden'); + + // Inject obfuscated email. To block low-effort scraping. + const addr = document.querySelector('address > a'); + addr.href = atob('bWFpbHRvOmFyZGlzQGFyZGlzbHUuZGV2'); + addr.textContent = atob('YXJkaXNAYXJkaXNsdS5kZXY='); diff --git a/index.html b/index.html index 0996156..df02776 100644 --- a/index.html +++ b/index.html @@ -111,7 +111,7 @@
- ardis@ardislu.dev +
diff --git a/script.js b/script.js index 52dd42c..5cc6af3 100644 --- a/script.js +++ b/script.js @@ -405,5 +405,10 @@ articleSkeleton.insertAdjacentHTML('beforeend', `); globalThis.components.set('article-skeleton', articleSkeleton); +/* Inject obfuscated email. To block low-effort scraping. */ +const addr = document.querySelector('address > a'); +addr.href = atob('bWFpbHRvOmFyZGlzQGFyZGlzbHUuZGV2'); +addr.textContent = atob('YXJkaXNAYXJkaXNsdS5kZXY='); + help(); showPage(location.pathname); // To support direct links to articles -- 2.47.3