Stack Exchange has Cloudflare's Email Address Obfuscation feature enabled, which replaces any email addresses it detects with the string [email protected]
, which is substituted for the actual email address with JavaScript a few moments after the page loads.
The script that Cloudflare injects to decode these email addresses currently lives at /cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js, but the gist of it is the following. As you can see, it's quite simple and given the prevalence of Cloudflare, I have no doubt that many of the folks that would still be scraping email addresses from the internet have already added it to their scripts.
const emails = [...document.querySelectorAll("[data-cfemail]")].map(element => {
const obfuscated = element.dataset.cfemail;
const digits = Array.from(
{length: obfuscated.length / 2},
(_, i) => parseInt(obfuscated.slice(i * 2, i * 2 + 2), 16)
);
const mask = digits[0];
const characters = digits.slice(1).map(x => x ^ mask);
return String.fromCodePoint(...characters);
});
This is not necessary. Email addresses are not public by default on Stack Exchange, so if a user posts it, it's because they want it to be discovered. I would like my email address to be visible to users without JavaScript. I would like my email address to be visible to search engines. I put it there because I want it to be visible, and I don't want it to be obfuscated.
The threat that this is protecting against is borderline-imaginary in 2024. I get a lot of spam, but almost all of it is semi-targeted based on where my email address has appeared in data leaks. It's not hard to venture into the dark corners of the internet and download lists of nearly a billion(!) leaked email addresses. Scraping the internet in the hopes of picking up a handful of email addresses here and there is rarely how these things are done, so this feature is not providing real value.
If anybody wants to follow this best practice of the 1990s, they can use one of the classic approaches to obfuscate their email addresses themselves. Don't force it on the rest of us.
To disable Email Address Obfuscation in the dashboard:
- Log into the Cloudflare dashboard ↗.
- Select your account and website.
- Go to Scrape Shield.
- For Email Address Obfuscation, switch the toggle to Off.
email_off
comments in the page source. They could have defined rules to disable it for specific routes, but I'd assume that's not the case.