Skip to content

Commit 315ff85

Browse files
authored
Create readme.md
1 parent a6caf02 commit 315ff85

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

readme.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# JavaScript Email Protection (JEP)
2+
3+
JEP is a simple JavaScript function that **protects email addresses** from bots scraping raw HTML. It dynamically writes obfuscated email links to the DOM.
4+
5+
## 🚀 Features
6+
**Obfuscates emails** using HTML character codes
7+
**Prevents basic scrapers** from reading raw email addresses
8+
**No manual decoding required** – browsers display the email correctly
9+
**Lightweight & simple** – only a few lines of JavaScript
10+
11+
## 📂 Project Structure
12+
```
13+
📂 jep-email-protection
14+
│── 📄 index.html # Example usage
15+
│── 📄 jep.js # JEP function
16+
│── 📄 README.md # Documentation
17+
```
18+
19+
## 🛠️ Usage
20+
21+
### 1️⃣ **Include the JavaScript File**
22+
Add `jep.js` to your project and include it in your HTML:
23+
24+
```html
25+
<script src="jep.js"></script>
26+
```
27+
28+
### 2️⃣ **Call `jep_link(domain, user)`** in Your HTML
29+
Use the `jep_link` function to insert an email link:
30+
31+
```html
32+
<p>Contact: <script>jep_link("example.com", "mailbox")</script></p>
33+
```
34+
35+
This dynamically generates:
36+
37+
```html
38+
<a href="mailto:mailbox@example.com">mailbox@example.com</a>
39+
```
40+
41+
But in the **HTML source**, it appears obfuscated:
42+
43+
```html
44+
<a href="mailto:mailbox@example.com">&#109;&#97;&#105;&#108;&#98;&#111;&#120;&#64;&#101;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;</a>
45+
```
46+
47+
## 🔐 How It Works
48+
1. **Scrapers scanning raw HTML won’t see the email** – only encoded characters.
49+
2. **Browsers automatically decode the characters**, displaying a normal email link.
50+
3. **Users can click the email as usual**, but bots won’t extract it easily.
51+
52+
## 📌 Future Improvements
53+
- Add **randomized obfuscation** to make detection harder.
54+
- Use **JavaScript decryption** for even stronger protection.
55+
56+
---
57+
58+
## 🤝 Contributing
59+
Feel free to improve the project and submit a pull request! 🚀
60+

0 commit comments

Comments
 (0)