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

Updated the README.md file of version-0.1 branch according to the updated branch #8

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 3 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

**Curse Cloak** is a cutting-edge Chrome extension designed to enhance your browsing experience by masking offensive language in real time. Say goodbye to unpleasant surprises in comments, articles, and social media feeds! With its intuitive functionality, **Curse Cloak** ensures a cleaner, more enjoyable online environment.

---

## 🚀 Features

- **Dynamic Filtering**: Instantly replaces offensive words with asterisks (****) to keep your reading experience clean and enjoyable.
- **Seamless Integration**: Works effortlessly across all websites—no configuration needed.
- **User-Friendly Interface**: Simple activation with a single click; no complex settings to navigate.
- **Customizable**: Easily extend the list of filtered words with your own `cuss_words.csv`.
- **Library-Driven**: Utilizes the `washyourmouthoutwithsoap` library for efficient and comprehensive cuss word filtering.

---

## ⚡ Getting Started

Expand All @@ -36,52 +33,26 @@
3. **Start Browsing**:
- Click the **Curse Cloak** icon in your toolbar to activate the filtering.

---

## 🌟 How It Works

- **Text Analysis**: As you browse, **Curse Cloak** scans the content on the webpage for any cuss words listed in `cuss_words.csv`.
- **Text Analysis**: As you browse, **Curse Cloak** scans the content on the webpage for any cuss words using the `washyourmouthoutwithsoap` library.
- **Dynamic Masking**: When a match is found, it replaces the offending word with asterisks (****), providing an immediate visual filter.

---

## 🛠️ Technical Details

- **Built with**:
- HTML, CSS, JavaScript
- Chrome Extensions API
- **Manifest Version**: 3
- **Cuss Word Filtering**: Utilizes the `washyourmouthoutwithsoap` library for advanced offensive language detection.

### Code Structure

- **`manifest.json`**: Configuration file for the extension.
- **`background.js`**: Handles background tasks and interactions.
- **`contentScript.js`**: Main logic for detecting and masking cuss words.
- **`cuss_words.csv`**: Contains a list of offensive words to be filtered.

---

## 📄 Customization

You can easily add more words to be filtered:

1. Open `cuss_words.csv`.
2. Add your cuss words, one per line.
3. Save and refresh your extension in Chrome.

---

## 🎉 Contributing

We welcome contributions! If you have ideas for new features or improvements, feel free to submit a pull request.

1. Fork the repository.
2. Create your own feature branch: `git checkout -b feature/my-feature`.
3. Commit your changes: `git commit -m 'Add some feature'`.
4. Push to the branch: `git push origin feature/my-feature`.
5. Open a pull request.

---


### 💡 Be part of the change. Browse smarter with **Curse Cloak**! 🌐
32 changes: 10 additions & 22 deletions contentScript.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@
import wash from 'washyourmouthoutwithsoap';

let cussWords = [];

// Function to fetch and parse cuss words from CSV
// Function to fetch and parse cuss words from washyourmouthoutwithsoap
function fetchCussWords() {
return fetch(chrome.runtime.getURL("cuss_words.csv"))
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`);
}
return response.text();
})
.then(data => {
const lines = data.split('\n');
cussWords = lines.map(line => line.trim()).filter(line => line !== '');
})
.catch(error => {
console.error('Error fetching cuss words:', error);
});
cussWords = wash.words('en')
}

// Function to apply a blur effect to cuss words
Expand All @@ -30,18 +19,17 @@ function blurCussWords(textNode) {

// Traverse all text nodes in the document and blur the cuss words
function traverseAndBlur(node) {
if (node.nodeType === Node.TEXT_NODE) {
if (node.nodeType === Node.TEXT_NODE) {
blurCussWords(node);
} else {
node.childNodes.forEach(childNode => traverseAndBlur(childNode));
}
}

// Start processing the webpage after fetching cuss words
fetchCussWords().then(() => {
chrome.storage.local.get(['extensionActive'], function (result) {
if (result.extensionActive !== false) {
traverseAndBlur(document.body);
}
});
fetchCussWords(); // Fetch cuss words from the library
chrome.storage.local.get(['extensionActive'], function (result) {
if (result.extensionActive !== false) {
traverseAndBlur(document.body);
}
});
25 changes: 0 additions & 25 deletions csv creater.py

This file was deleted.

83 changes: 0 additions & 83 deletions cuss_words.csv

This file was deleted.

1 change: 1 addition & 0 deletions dist/contentScript.bundle.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions images/swearWords.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
anal,anus,arse,ass,ballsack,balls,bastard,bitch,biatch,bloody,blowjob,blow job,bollock,bollok,boner,boob,bugger,bum,butt,buttplug,clitoris,cock,coon,crap,cunt,damn,dick,dildo,dyke,fag,feck,fellate,fellatio,felching,fuck,f u c k,fudgepacker,fudge packer,flange,Goddamn,God damn,hell,homo,jerk,jizz,knobend,knob end,labia,lmao,lmfao,muff,nigger,nigga,omg,penis,piss,poop,prick,pube,pussy,queer,scrotum,sex,shit,s hit,sh1t,slut,smegma,spunk,tit,tosser,turd,twat,vagina,wank,whore,wtf
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"<all_urls>"
],
"js": [
"contentScript.js"
"dist/contentScript.bundle.js"
]
}
],
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

10 changes: 10 additions & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const path = require('path');

module.exports = {
mode: 'production',
entry: './contentScript.js',
output: {
path: path.resolve(__dirname, 'dist'),
filename: 'contentScript.bundle.js'
}
};