Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obfuscate emails in compiled js #351

Closed
g-vernon opened this issue Mar 5, 2024 · 1 comment
Closed

Obfuscate emails in compiled js #351

g-vernon opened this issue Mar 5, 2024 · 1 comment

Comments

@g-vernon
Copy link

g-vernon commented Mar 5, 2024

Is your feature request related to a problem? Please describe.
Assuming a normal build process and the example usage described in README.md, the example input produces an output that specifies the email in plaintext in the .js that is served. In this case, usage of react-obfuscate provides no protection, because certainly a malicious web-crawler which goes to the greater difficulty of rendering the DOM to harvest emails will also scan the .js for emails.

Describe the solution you'd like
I suggest that README.md should not claim that the <Obfuscate> component makes the email or link given in the example useless for spammers, and should detail the additional steps required to protect emails and links from spammers.

Given that there are 12,000 downloads per month for this package, improving it to obfuscate the children and props of the <Obfuscate> tag in the compiled source might be worth doing.

Describe alternatives you've considered
javascript-obfuscator can be used mangle string literals in source code appropriately, or they might be scrambled by hand and recovered with vanilla JavaScript.

@coston
Copy link
Owner

coston commented Mar 6, 2024

Hey @g-vernon, thank you for your interest in the topic.

Parsing JavaScript bundles to extract email addresses is not a common approach for website scrapers. Parsing JavaScript bundles adds significant complexity and overhead to the scraping process. JavaScript files can be minified, obfuscated, or loaded dynamically, making it challenging to reliably extract email addresses.

Most scrapers focus on parsing the HTML DOM (directly or utilizing browser automation tools like Selenium to render the page and extract information.)

Based on this knowledge, I'm content with the current implementation.

@coston coston closed this as completed Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants