From: Ardis Lu Date: Wed, 1 May 2024 01:59:57 +0000 (-0700) Subject: Inject email into HTML pages X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=a35043bcaf986fef371db734c8e5f0271a7291c2;p=ardislu.dev Inject email into HTML pages Replaces Cloudflare's email-decode.min.js --- 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