-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcontent.js
199 lines (182 loc) · 6.55 KB
/
content.js
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
console.log('Your Lecture extension is working!')
function randomChoice(list) {
if(list.length == 0) return('')
return(list[Math.round(Math.random()*(list.length-1))])
}
const pages = [
{
"url": 'github.com',
"lectures": [
"What a git; they're using github again.",
"Touch Grass."
]
},
{
"url": "reddit.com",
"lectures": [
"Most of the information on reddit is negative or pointless. You rarely learn something and normally just consume other people's opinions.",
"People spend hours of their life screaming at people on reddit. Do you really want to be on this platform?"
]
},
{
"url": "facebook.com",
"lectures": [
"You might think you're just catching up with people, but most of Facebook is just <b>noise</b>, <b>arguments</b>, <b>gossip</b> or things you don't really even care about.",
"Do you relly care about how many likes you get?",
"Fun fact: Facebook doesn't have as many pictures of faces as you might think. Touch grass."
]
},
{
"url": "instagram.com",
"lectures": [
"People are awlays comparing themselves on instagram. It's really not healthy. Touch grass.",
"People only post the best parts of their lives on the gram. Go talk to people irl.",
"Those likes don't mean much. Touch grass",
"Go take a hike. Have you seen those national parks? Instagram doesn't matter."
]
},
{
"url": "archive.org",
"lectures": [
"Wow I didn't think you were that old. Look at them, staring back at their childhood.",
"Stop looking at the past, think about the future!"
]
},
{
"url": "mail.google.com",
"lectures": [
"Why do you have so many emails?",
"What are you, famous? You have way to many emails. Go do something more productive."
]
},
{
"url": "wikipedia.org",
"lectures": [
"Go read a book."
]
},
{
"url": "youtube.com",
"lectures": [
"STOP WATCHING SKIBIDI TOILET!",
"Be more productive. Get off Youtube. Do it."
]
},
{
"url": "netflix.com",
"lectures": [
"Continue Watching? No, don't.",
"Go touch grass.",
"You've seen this show 5 times allready."
]
},
{
"url": "yahoo.com",
"lectures": [
"Don't tell me you have a yahoo email address. That's unaceptable.",
"Yahoo! That's the average sound when someone closes yahoo and their computer and then takes a walk. Outside."
]
},
{
"url": "openai.com",
"lectures": [
"ChatGPT isn't real. It just guesses the next word. Go make a real freind.",
"You really think ChatGPT can answer better than a book?",
"The end is near.",
"What is real? How do you define 'real'? If you're talking about what you can feel, what you can smell, what you can taste and see, then 'real' is simply electrical signals interpreted by your brain.",
"I know what you're thinking, 'cause right now I'm thinking the same thing. Actually, I've meen think it ever since I got here: Why oh why didn't I take the BLUE pill?"
]
},
{
"url": "amazon.com",
"lectures": [
"STOP INPULSE BUYING!",
"Stop being lazy, go to a real store!"
]
},
{
"url": "craigslist.org",
"lectures": [
"STOP INPULSE BUYING!",
"At least go to a garage sale in real life!"
]
},
{
"url": "orteil.dashnet.org",
"lectures": [
"How many cookies do you have?!?",
"STOP CLICKING THE COOKIE"
]
}
]
let lecture = []
pages.forEach((e) => {
if(document.location.host.includes(e.url)) {
e.lectures.forEach((l) => {
lecture.push(l)
})
}
})
lecture = randomChoice(lecture)
class Div {
constructor() {
this.titles = [
"We've talked about this a million times already!",
"Why do I even have to say it again!?!",
"You know exatly what you're supposed to do!",
"I expected better from you!",
"You are no user of mine!",
"I'm putting my foot down!",
"It's about time that I teach you a lesson.",
"How many times do we need to go over this before it actually sticks?",
"Honestly, do you think I enjoy repeating myself over and over?",
"Why is it that every time I turn around, you're wasting your time on the internet?",
"Is it really that difficult to follow one simple instruction?",
"I don't understand how you can walk past this mess and not notice it.",
"It's almost like you're trying to set a record for how long you can procrastinate.",
"We shouldn't have to talk about this every single day; it's getting ridiculous.",
"Do you think I like spending all my time lecturing you?",
"I've lost count of how many times I've asked you to take care of this.",
"Do you realize how frustrating it is to keep having the same conversation?",
"This isn't new information, so why does it feel like I'm constantly reminding you?",
"I just don't understand why simple tasks are treated like they're impossible.",
"You keep promising to do better, but I'm still waiting to see any improvment.",
"Do I have to write it down and post it on every page for you to remember?",
"At this point, I'm not sure if you're ignoring me or just forgetting everything."
]
this.box = document.createElement('div')
this.box.classList.add("lecturebox")
this.title = document.createElement('h1')
this.icon = document.createElement('img')
this.icon.src = chrome.runtime.getURL('icon.png')
this.title.innerText = randomChoice(this.titles)
this.mesg = document.createElement('p')
this.mesg.innerHTML = lecture
this.close = document.createElement('button')
this.close.innerText = "Ignore life adivce"
this.close.addEventListener('click', close)
}
display() {
if(lecture.length > 0) {
let style = document.createElement('link')
style.rel = "stylesheet"
style.href = chrome.runtime.getURL('content.css')
document.head.appendChild(style)
let target = document.createElement('base')
target.target = "_blank"
document.head.appendChild(target)
this.title.prepend(this.icon)
this.box.appendChild(this.title)
this.box.appendChild(this.mesg)
this.box.appendChild(this.close)
document.body.appendChild(this.box)
}
}
}
let div = new Div()
window.addEventListener("load", () => {
div.display()
})
function close() {
div.box.remove()
}