Skip to content

Commit

Permalink
updating temporary slurList
Browse files Browse the repository at this point in the history
  • Loading branch information
hardik-pratap-singh committed Aug 31, 2024
1 parent 5710c8b commit f3fee9a
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 29 deletions.
66 changes: 39 additions & 27 deletions browser-extension/plugin/src/transform-general.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,34 @@ function setCaretPosition(element, offset) {
const processNewlyAddedNodesGeneral2 = function (firstBody) {

// const config = { attributes: true, childList: true, subtree: true };
const callback = () => {
console.log("HEY THERE !!!")
let targetWords = ["Blog" , "BLOG", "Choose" , "domain", "bad", "BAD" , "Bad" , "Stupid" , "STUPID" , "stupid", "crazy", "Crazy", "mad", "Mad", "MAD" , "CRAZY"]
let uliStore = []
// getAllTextNodes(document.body, uliStore)
getAllTextNodes(firstBody, uliStore)
console.log(uliStore)
abc = locateSlur(uliStore, targetWords)
console.log("uliStore", abc)
addMetaData(targetWords)
}

callback() ;
console.log("HEY THERE !!!")
let targetWords = ["Blog", "BLOG", "Choose", "domain", "bad", "BAD", "Bad", "Stupid", "STUPID", "stupid", "crazy", "Crazy", "mad", "Mad", "MAD", "CRAZY" , "ABLANARI", "AblaNari", "ablanari", "chakka",
"jihidis", "Jihadi", "Jihidi", "zehadi", "jehadan",
"Chakko", "chakki", "chaka", "Chinal", "Randi", "ramdi", "Randie", "randya", "randikhana",
"Lulli", "Gasti", "Meetha", "Halwa", "Gud", "Gandu", "Gaand", "Gandiaal", "lodu", "kutiya"

]

// "जिहादी", "छक्का", "छिनाल", "रंडी", "रण्डी", "रांड", "रंडीखाना", "लुल्ली", "गांड", "कुतिया", "कुत्ती", "बत्तमीज़", "कुल्टा", "हरामजादी", "साली", "चुदाई", "भोस्डीके", "लोड़ू", "मादरचोद", "लानती", "छुतीये", "चूत", "लौड़ा", "लौड़े", "लिब्राण्डू", "पुंगी", "पागल", "बाज़ारू", "बलात्कार", "बदसूरत", "मुजरा", "औरत-ए-जाहिल", "भोसड़ीwala", "म्लेच्छा", "सूअर", "दोगली", "🏹🏹", "पनौती", "हरामी", "गधी", "पिछवाड़ा", "हगना", "सुल्ली", "हिज़रापंती", "तवाइफ़", "किन्नर", "गद्दार", "चमचा", "चमची", "आतंकवादी", "मुलिया", "Katwa", "चाटुकार", "चुस्लिम", "चुस्लामि", "चुसल्मान", "चूस", "भीमटा", "भीमटी", "बैल", "भद्दी", "भांड", "भाड़े", "नल्ली", "मादरजात", "भड़वा", "चूची", "टट्टी", "मूत", "नाजायज़", "देहातन", "देहाती", "गणिका", "हबशी",

// const observer = new MutationObserver(callback);
// observer.observe(firstBody , config);
let slurList = [ "kutti", "Badchalan", "Battameez", "kulta", "haramjadi", "dyan", "saali", "sali", "chooda", "chuda", "Bhdsk", "bsdk", "bhosad", "bhosdiwale", "Lodu", "bhenchod", "Madarchod", "Maderchod", "mcp", "mc", "Lanti", "chutiye", "chutiya", "chutie", "chutia", "chutan", "Lavde","Rakhail", "librandu", "bazaru", "balatkar", "Ugly", "Mujra", "mujra", "hilana", "hilaogi", "Mlechcha", "Suar", "doghli", "Panauti", "panooti", "harami", "gadhi", "kalmuhi", "pichwada", "jhadu", "bai", "naali", "hagna", "Sulli", "Tawaif", "Dhimmihood", "izzlam", "gaddar", "chamcha", "chamchi", "aatankwadi", "Mulliya", "Uncut", "chatukar", "Kachra", "Chuslim", "chuslami", "Chusalmans", "Bhimta", "Budhdhi", "Gatiya", "nalli", "bhootni", "madarjaat", "bhadva", "bhadvi", "bhandve", "chuchi", "tatti", "mooh", "mutth", "Pataka", "Ganika", "chewtypa", "atrocuty_act", "RandiKutiya", "sulli", "lovejihad", "dull-it", "Presstitutes", "libtard", "bimbo", "slims", "faggot", "Sissy", "whore", "chrislamocommies", "piddilover", "Chinks", "chinky", "Feminazi", "Mulli", "halala", "Scumreds", "scumbags", "burnol", "pheminist", "dented-painted", "Muzlim", "Buzlim", "Izzlam", "pissfull", "Simp", "Bitch", "sekoolar", "sickular", "Ferrorists", "Cunt", "Slut", "pussy", "ugly", "promiscuous", "fat", "fag", "homo", "hoe", "motherfucker", "sisterfucker", "bastard", "bint", "dyke", "gash", "muslimette", "muttah", "scag", "assfucker", "boobs", "boobies", "Melons", "lesbain", "moslem", "nasty", "redlight", "nymph", "piss", "pimp", "poop", "pube", "puke", "retarded", "slave", "sissy", "mothafucka", "mothafucked", "mothafucker", "motherfucked", "motherfucking", "lesbain", "lesbayn", "lesbian", "lesbin", "lesbo", "nastyslut", "nastywhore", "nastybitch", "nastyho", "Koodhi", "pottai", "Aththai", "athai", "loosu", "fuck", "cunt", "stupid", "Stupid", "crazy", "Crazy", "mad", "MAD"];


// let targetWords = slurList ;
let uliStore = []
// getAllTextNodes(document.body, uliStore)
getAllTextNodes(firstBody, uliStore)
// console.log(uliStore)
abc = locateSlur(uliStore, targetWords)
// console.log("uliStore", abc)
addMetaData(targetWords)
}





const processNewlyAddedNodesGeneral = function (firstBody) {
log('processing new nodes');
const config = { attributes: true, childList: true, subtree: true };
Expand Down Expand Up @@ -177,7 +183,8 @@ function locateSlur(uliStore, targetWords) {
if (Object.keys(pos).length !== 0) {
slurs.push(pos)
}



if (tempParent.innerHTML.includes(targetWord)) {
const className = `icon-container-${targetWord}`;
const parts = tempParent.innerHTML.split(targetWord);
Expand Down Expand Up @@ -214,6 +221,7 @@ function locateSlur(uliStore, targetWords) {
function addMetaData(targetWords) {
targetWords.forEach(targetWord => {
const className = `icon-container-${targetWord}`
console.log(className)
const elements = Array.from(document.querySelectorAll(`.${className}`))
elements.forEach(element => {

Expand All @@ -223,7 +231,9 @@ function addMetaData(targetWords) {
img.style.height = "2%"
img.style.width = "2%"
img.style.cursor = "pointer"

img.src = "https://upload.wikimedia.org/wikipedia/commons/4/43/Minimalist_info_Icon.png"
// img.src = "./icon16.png"
// img.src = "./info.png"
img.alt = "altText"

Expand Down Expand Up @@ -259,18 +269,20 @@ function addMetaData(targetWords) {



if (targetWord.toLowerCase() === "crazy") {
span.innerHTML = `It can perpetuate stereotypes about mental health and may be hurtful to those with mental health conditions.`
}
else if (targetWord.toLowerCase() === "mad") {
span.innerHTML = `Using "mad" to describe someone negatively can be insensitive.`
}
else if (targetWord.toLowerCase() === 'stupid') {
span.innerHTML = `Describing actions or decisions as "stupid" can be demeaning and hurtful.`
}
else {
span.innerHTML = `This word is considered offensive.`
}
// if (targetWord.toLowerCase() === "crazy") {
// span.innerHTML = `It can perpetuate stereotypes about mental health and may be hurtful to those with mental health conditions.`
// }
// else if (targetWord.toLowerCase() === "mad") {
// span.innerHTML = `Using "mad" to describe someone negatively can be insensitive.`
// }
// else if (targetWord.toLowerCase() === 'stupid') {
// span.innerHTML = `Describing actions or decisions as "stupid" can be demeaning and hurtful.`
// }
// else {
//
// }

span.innerHTML = `This word is considered offensive.`


sup.appendChild(img)
Expand Down
3 changes: 2 additions & 1 deletion browser-extension/plugin/src/ui-components/pages/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ export function App() {
setUser(user);
setAccountActivated(true);
await setPreferenceData({
enableSlurReplacement: true
enableSlurReplacement: true,
enableSlurMetadata: false
});
userBrowserTabs.reload();
navigate('/preferences');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function Preferences() {
async function getPrefsLocalStorage() {
try {
const preference = await getPreferenceData();
console.log("preference " , preference)
if (!ignore) {
// console.log({ preference });
setLocalPreferences(preference);
Expand Down Expand Up @@ -93,6 +94,8 @@ export function Preferences() {

async function handleSlurReplacement(enableSlurReplacement) {
try {
setEnableSlurMetadata(false);

const confirmed = window.confirm(
'This action requires a page reload. Do you want to continue?'
);
Expand Down Expand Up @@ -121,6 +124,8 @@ export function Preferences() {

async function handleSlurMetadata(enableSlurMetadata) {
try {
setEnableSlurReplacement(false)

const confirmed = window.confirm(
'This action requires a page reload. Do you want to continue?'
);
Expand Down Expand Up @@ -181,7 +186,7 @@ export function Preferences() {
enableSlurReplacement !== preferenceInLS.enableSlurReplacement;

const enableSlurMetadataChanged =
enableSlurMetadata !== preferenceInLS.enableSlurMetadata;
enableSlurMetadata !== preferenceInLS.enableSlurMetadata;

if (enableSlurReplacementChanged) {
console.log('enable val changed', enableSlurReplacementChanged);
Expand Down

0 comments on commit f3fee9a

Please sign in to comment.