-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmyScript.js
More file actions
54 lines (47 loc) · 969 Bytes
/
Copy pathmyScript.js
File metadata and controls
54 lines (47 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
function findprofanity(input) {
var bad_words=[
"add",
"bad",
"words",
"here"
];
var i = 0;
var indexWord = 0;
input=input.toLowerCase();
input=input.replace(/[\W_]+/g," ");
var in_words=input.split(' ');
while (i < in_words.length)
{
indexWord = bad_words.indexOf(in_words[i]);
if (indexWord>=0)
{
return true;
}
i=i+1;
}
return false;
}
function all() {
//var x = document.getElementsByTagName('h1')[0].innerText;
//chrome.runtime.sendMessage(x);
var x = document.getElementsByTagName("*");
var i = 0;
var s = "";
debugger;
console.log(i);
var prof;
var text = "hello";
var profCounter = 0;
prof == findprofanity(text);
while (x[i]) {
text = x[i].innerText;
prof = findprofanity(text);
if (prof) {
profCounter += 1;
x[i].style.color = "transparent";
x[i].onmousedown = "return false;";
}
i += 1; //check if error here
}
}
document.addEventListener('DOMContentLoaded', all());