Hi there, I’ve built a Cloudflare Pages website with Swup js library for smooth transitions between subpages which works using AJAX to replace the content if I’m not wrong.
I share my email on my website and it’s working fine until we start actually exploring the subpages and Swup starts doing its thing.
First (1) we can see the email on the homepage,
then (2) we replace the content by going to a subpage,
then (3) we reload homepage again and now it’s changed to [email protected].
Eventually I would like to make it work, but right now I’m trying to assess what’s even happening. It’s a plain html website not using any framework, just swup js.
I would greatly appreciate any insight.
It seems that the issue you’re experiencing might be related to Scrape Shield’s email obfuscation being triggered by Swup js. Scrape Shield is a feature of Cloudflare that helps protect email addresses on your website from being harvested by bots. It does this by obfuscating the email address on your website and replacing it with a Cloudflare-generated email address that forwards to your actual email address.
You might want to check if Scrape Shield’s email obfuscation is enabled on your Cloudflare account and if disabling it resolves the issue.
Yes, I’m aware of the Scrape Shield, hence the title. Obviously turning it off will resolve the issue, but that’s throwing the baby out with the bathwater. I’m trying to figure out if it’s possible to keep it on while simultaneously using Swup js or other similar libraries.
I would appreciate not using ChatGPT for my issue though. Thanks.
I’m wondering if your email has to be in the correct na[email protected] format or you can try replacing name[at]domain.tld
Sincerely sorry that without more detailed information from you, it is quite difficult to find a solution, especially for errors related to the source code or conflicts.
To solve it completely, try turning on debug mode, and maybe use chrome to debug the error, see where the conflict occurs.
Sorry that my English is not very good which may cause misunderstandings for you/
Did you try to read this, there is a solution there in your case, but i’m not sure if it work as i said above, it hard to find a solution of we do not have enough information
Thank you, yes I have read the documentation. The part that I think may be relevant is:
To prevent Cloudflare from obfuscating emails, you can:
Return email addresses in JSON format for AJAX calls, making sure your web server returns a content type of “application/json”.
Which led me to believe it’s probably related to Swup js using AJAX, but I’m not 100% certain. Anyway, I believe it’s a highly technical issue and I probably need help from someone who knows exactly what’s responsible on a programming level. Right now I’m assuming it’s AJAX and I’ll probably start looking into implementing the instructions from the documentation.
This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.