Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
niknal357 authored Mar 30, 2023
1 parent 802a6a3 commit a208b89
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 29 deletions.
89 changes: 64 additions & 25 deletions content.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,14 @@ function uwuafy(text) {
replacedText += 'W';
} else if (currentChar == 'l' || currentChar == 'r' || currentChar == 'v') {
replacedText += 'w';
} else if (currentChar == 'O') {
if (previousChar == 'N' || previousChar == 'M') {
replacedText += 'YO';
} else if (previousChar == 'n' || previousChar == 'm') {
replacedText += 'yO';
} else {
replacedText += currentChar;
}
} else if (currentChar == 'o') {
if (previousChar == 'N' || previousChar == 'M') {
} else if (currentChar == 'O' || currentChar == 'o') {
if (previousChar == 'N' || previousChar == 'n' || previousChar == 'M' || previousChar == 'm') {
replacedText += 'yo';
} else if (previousChar == 'n' || previousChar == 'm') {
replacedText += 'yo';
} else {
replacedText += currentChar;
}
} else if (currentChar == 'A') {
if (previousChar == 'N' || previousChar == 'M') {
replacedText += 'YA';
} else if (previousChar == 'n' || previousChar == 'm') {
replacedText += 'yA';
} else {
replacedText += currentChar;
}
} else if (currentChar == 'a') {
if (previousChar == 'N' || previousChar == 'M') {
replacedText += 'ya';
} else if (previousChar == 'n' || previousChar == 'm') {
} else if (currentChar == 'A' || currentChar == 'a') {
if (previousChar == 'N' || previousChar == 'n' || previousChar == 'M' || previousChar == 'm') {
replacedText += 'ya';
} else {
replacedText += currentChar;
Expand All @@ -53,9 +33,13 @@ function uwuafy(text) {
replacedText += currentChar;
}
}
//if (previousChar == '.') {
// replacedText += '.';
//}
return replacedText;
}

//const ignore = ["www.google.com", "google.com", "www.youtube.com", "youtube.com"];
const ignore = [];
var passing = false;
chrome.storage.sync.get(["toggled"], function(res) {
Expand All @@ -69,16 +53,71 @@ chrome.storage.sync.get(["toggled"], function(res) {

for (var i = 0; i < elements.length; i++) {
var element = elements[i];
if (element.tagName == "STYLE" || element.tagName == "SCRIPT" || element.tagName == "DIV") {
if (element.tagName == "STYLE") {
//console.log("style");
continue;
}
//setTimeout(() => {
document.title = uwuafy(document.title);
for (var j = 0; j < element.childNodes.length; j++) {
var node = element.childNodes[j];
if (node.nodeType === 3) {
var text = node.nodeValue;
node.nodeValue = uwuafy(text);
//var replacedText = text;

//replacedText = replacedText.replace(/r/, 'w');
//replacedText = replacedText.replace(/R/, 'W');
//replacedText = replacedText.replace(/l/, 'w');
//replacedText = replacedText.replace(/L/, 'W');
//replacedText = replacedText.replace(/v/, 'w');
//replacedText = replacedText.replace(/V/, 'W');
//replacedText = replacedText.replace(/no/, 'nyo');
//replacedText = replacedText.replace(/na/, 'nya');
//replacedText = replacedText.replace(/No/, 'Nyo');
//replacedText = replacedText.replace(/Na/, 'Nya');
//replacedText = replacedText.replace(/NO/, 'NYO');
//replacedText = replacedText.replace(/NA/, 'NYA');
//replacedText = replacedText.replace(/mo/, 'myo');
//replacedText = replacedText.replace(/ma/, 'mya');
//replacedText = replacedText.replace(/Mo/, 'Myo');
//replacedText = replacedText.replace(/Ma/, 'Mya');
//replacedText = replacedText.replace(/MO/, 'MYO');
//replacedText = replacedText.replace(/MA/, 'MYA');
//replacedText = replacedText.replace(/q\./, 'q uwu.');
//replacedText = replacedText.replace(/w\./, 'w uwu.');
//replacedText = replacedText.replace(/e\./, 'e uwu.');
//replacedText = replacedText.replace(/r\./, 'r uwu.');
//replacedText = replacedText.replace(/t\./, 't uwu.');
//replacedText = replacedText.replace(/y\./, 'y uwu.');
//replacedText = replacedText.replace(/i\./, 'i uwu.');
//replacedText = replacedText.replace(/o\./, 'o uwu.');
//replacedText = replacedText.replace(/p\./, 'p uwu.');
//replacedText = replacedText.replace(/a\./, 'a uwu.');
//replacedText = replacedText.replace(/s\./, 's uwu.');
//replacedText = replacedText.replace(/d\./, 'd uwu.');
//replacedText = replacedText.replace(/f\./, 'f uwu.');
//replacedText = replacedText.replace(/g\./, 'g uwu.');
//replacedText = replacedText.replace(/h\./, 'h uwu.');
//replacedText = replacedText.replace(/j\./, 'j uwu.');
//replacedText = replacedText.replace(/k\./, 'k uwu.');
//replacedText = replacedText.replace(/l\./, 'l uwu.');
//replacedText = replacedText.replace(/z\./, 'z uwu.');
//replacedText = replacedText.replace(/x\./, 'x uwu.');
//replacedText = replacedText.replace(/c\./, 'c uwu.');
//replacedText = replacedText.replace(/v\./, 'v uwu.');
//replacedText = replacedText.replace(/b\./, 'b uwu.');
//replacedText = replacedText.replace(/n\./, 'n uwu.');
//replacedText = replacedText.replace(/m\./, 'm uwu.');
//replacedText = replacedText.replace(/\. /, ' uwu. ')

//alert(text);
//if (text !== replacedText) {
// element.replaceChild(document.createTextNode(replacedText), node);
//}
}
}
//}, 1 * i)
}
}, 100)
}
Expand Down
Binary file modified icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icon700.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 5 additions & 4 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"manifest_version": 3,
"name": "uwufyer",
"name": "uwuafyer",
"icons": {
"256": "icon.png"
"256": "icon256.png",
"700": "icon700.png"
},
"description": "uwufys text",
"description": "uwuafys text",
"version": "0.1",
"permissions": [
"storage",
Expand All @@ -13,7 +14,7 @@
"action": {
"default_icon": "icon.png",
"default_popup": "popup.html",
"default_title": "toggle uwufyer"
"default_title": "toggle uwuafyer"
},
"content_scripts": [{
"matches": [
Expand Down

0 comments on commit a208b89

Please sign in to comment.