3333 * along with this program. If not, see <https://www.gnu.org/licenses/>.
3434 */
3535// Check current site
36- let url = window . location . href . split ( "/" ) [ 2 ] . replace ( " www." , "" ) ;
36+ let url = window . location . href . split ( '/' ) [ 2 ] . replace ( ' www.' , '' ) ;
3737let site = - 1 ;
3838let altMode = 0 ;
3939switch ( url ) {
40- case " 10fastfingers.com" :
41- console . log ( " ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: 10FastFingers\n~~~~~~~~~~~~~~~~~~~" ) ;
40+ case ' 10fastfingers.com' :
41+ console . log ( ' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: 10FastFingers\n~~~~~~~~~~~~~~~~~~~' ) ;
4242 site = 0 ;
43- if ( window . location . href . split ( "/" ) [ 3 ] == " text" ) altMode = 1 ;
43+ if ( window . location . href . split ( '/' ) [ 3 ] == ' text' ) altMode = 1 ;
4444 break ;
45- case " typeracer.com" :
46- case " play.typeracer.com" :
47- console . log ( " ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypeRacer\n~~~~~~~~~~~~~~~~~~~" ) ;
45+ case ' typeracer.com' :
46+ case ' play.typeracer.com' :
47+ console . log ( ' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypeRacer\n~~~~~~~~~~~~~~~~~~~' ) ;
4848 site = 1 ;
4949 break ;
50- case " typingtestnow.com" :
51- console . log ( " ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypingTestNow\n~~~~~~~~~~~~~~~~~~~" ) ;
50+ case ' typingtestnow.com' :
51+ console . log ( ' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: TypingTestNow\n~~~~~~~~~~~~~~~~~~~' ) ;
5252 site = 2 ;
5353 break ;
54- case " bing.com" :
55- console . log ( " ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: Bing Test\n~~~~~~~~~~~~~~~~~~~" ) ;
54+ case ' bing.com' :
55+ console . log ( ' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: Bing Test\n~~~~~~~~~~~~~~~~~~~' ) ;
5656 site = 3 ;
5757 break ;
58- case " livechatinc.com" :
59- console . log ( " ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: LiveChat Inc\n~~~~~~~~~~~~~~~~~~~" ) ;
58+ case ' livechatinc.com' :
59+ console . log ( ' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: LiveChat Inc\n~~~~~~~~~~~~~~~~~~~' ) ;
6060 site = 4 ;
6161 break ;
62- case " quicktypingtest.com" :
63- console . log ( " ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: QuickTypingTest\n ~~~~~~~~~~~~~~~~~~~" ) ;
62+ case ' quicktypingtest.com' :
63+ console . log ( ' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: QuickTypingTest\n ~~~~~~~~~~~~~~~~~~~' ) ;
6464 site = 5 ;
6565 break ;
66- case " typing-speed-test.aoeu.eu" :
67- console . log ( " ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: AOEU Test\n~~~~~~~~~~~~~~~~~~~" ) ;
66+ case ' typing-speed-test.aoeu.eu' :
67+ console . log ( ' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: AOEU Test\n~~~~~~~~~~~~~~~~~~~' ) ;
6868 site = 6 ;
6969 break ;
70- case " indiatyping.com" :
71- console . log ( " ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: India Typing\n~~~~~~~~~~~~~~~~~~~" ) ;
70+ case ' indiatyping.com' :
71+ console . log ( ' ~~~~~~~~~~~~~~~~~~~\n TypeCheat Active! \nSite: India Typing\n~~~~~~~~~~~~~~~~~~~' ) ;
7272 site = 7 ;
7373 break ;
7474}
@@ -79,7 +79,7 @@ let tText, tWords, cWord, tField, workWord;
7979// 10FastFingers
8080function tenFastCheat ( ) {
8181 // Generate wordlist
82- tText = document . getElementById ( " row1" ) ;
82+ tText = document . getElementById ( ' row1' ) ;
8383 tWords = [ ] ;
8484 for ( let i = 0 ; i < tText . children . length ; i ++ ) {
8585 tWords . push ( tText . children [ i ] . innerText ) ;
@@ -89,42 +89,42 @@ function tenFastCheat() {
8989 // Different method for different modes
9090 tField = null ;
9191 if ( altMode == 0 ) {
92- tField = document . getElementById ( " inputfield" ) ;
92+ tField = document . getElementById ( ' inputfield' ) ;
9393 } else if ( altMode == 1 ) {
94- tField = document . getElementById ( " text_typed" ) ;
94+ tField = document . getElementById ( ' text_typed' ) ;
9595 }
96- tField . addEventListener ( " keyup" , function ( e ) {
96+ tField . addEventListener ( ' keyup' , function ( e ) {
9797 if ( e . keyCode == 32 ) {
9898 tField . value = tWords [ cWord ] ;
9999 cWord ++ ;
100100 }
101101 } ) ;
102102 // Change button colour to show that it has activated
103- document . getElementById ( " ads-speedtest-view-container" ) . children [ 0 ] . style = " width: 100%; color: #0F0;" ;
103+ document . getElementById ( ' ads-speedtest-view-container' ) . children [ 0 ] . style = ' width: 100%; color: #0F0;' ;
104104}
105105
106106// TypeRacer
107107function typeRacerCheat ( ) {
108108 // Generate wordlist
109- tText = document . querySelector ( " #gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td" ) ;
110- tWords = tText . innerText . split ( " " ) ;
109+ tText = document . querySelector ( ' #gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(1) > td > table > tbody > tr:nth-child(1) > td' ) ;
110+ tWords = tText . innerText . split ( ' ' ) ;
111111 // Cheat
112112 cWord = 0 ;
113- tField = document . querySelector ( " #gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > input" ) ;
114- tField . addEventListener ( " keydown" , function ( e ) {
113+ tField = document . querySelector ( ' #gwt-uid-15 > table > tbody > tr:nth-child(2) > td > table > tbody > tr:nth-child(2) > td > input' ) ;
114+ tField . addEventListener ( ' keydown' , function ( e ) {
115115 if ( e . keyCode == 32 ) {
116116 tField . value = tWords [ cWord ] ;
117117 cWord ++ ;
118118 }
119119 } ) ;
120120 // Change button colour to show that it has activated
121- document . getElementsByClassName ( " navigation" ) [ 0 ] . children [ 0 ] . style = " width: 100%; color: #0F0;" ;
121+ document . getElementsByClassName ( ' navigation' ) [ 0 ] . children [ 0 ] . style = ' width: 100%; color: #0F0;' ;
122122}
123123
124124// TypingTestNow
125125function typingTestNowCheat ( ) {
126126 // Generate wordlist
127- tText = document . getElementsByClassName ( " sample-text" ) [ 0 ] ;
127+ tText = document . getElementsByClassName ( ' sample-text' ) [ 0 ] ;
128128 tWords = [ ] ;
129129 for ( let i = 0 ; i < tText . children . length ; i ++ ) {
130130 for ( let j = 0 ; j < tText . children [ i ] . children . length ; j ++ ) {
@@ -133,57 +133,57 @@ function typingTestNowCheat() {
133133 }
134134 // Cheat
135135 cWord = 0 ;
136- tField = document . getElementById ( " practice-input" ) ;
137- tField . addEventListener ( " keydown" , function ( e ) {
136+ tField = document . getElementById ( ' practice-input' ) ;
137+ tField . addEventListener ( ' keydown' , function ( e ) {
138138 if ( e . keyCode == 32 ) {
139139 tField . value = tWords [ cWord ] ;
140140 cWord ++ ;
141141 }
142142 } ) ;
143143 // Change button colour to show that it has activated
144- document . getElementsByClassName ( " row" ) [ 0 ] . children [ 0 ] . style = " width: 100%; color: #0F0;" ;
144+ document . getElementsByClassName ( ' row' ) [ 0 ] . children [ 0 ] . style = ' width: 100%; color: #0F0;' ;
145145}
146146
147147// Bing Typing Test
148148function bingCheat ( ) {
149149 // Generate wordlist
150- tText = document . getElementById ( " edu_promptText" ) ;
150+ tText = document . getElementById ( ' edu_promptText' ) ;
151151 tWords = [ ] ;
152- let workWord = "" ;
152+ let workWord = '' ;
153153 for ( let i = 0 ; i < tText . children . length ; i ++ ) {
154154 for ( let j = 0 ; j < tText . children [ i ] . children . length ; j ++ ) {
155- if ( tText . children [ i ] . children [ j ] . className == " space" ) {
155+ if ( tText . children [ i ] . children [ j ] . className == ' space' ) {
156156 tWords . push ( workWord ) ;
157- workWord = "" ;
157+ workWord = '' ;
158158 } else {
159159 workWord += tText . children [ i ] . children [ j ] . innerText ;
160160 }
161161 }
162162 }
163163 // Cheat
164164 cWord = 0 ;
165- tField = document . getElementById ( " edu_inputText" ) ;
166- tField . addEventListener ( " keydown" , function ( e ) {
165+ tField = document . getElementById ( ' edu_inputText' ) ;
166+ tField . addEventListener ( ' keydown' , function ( e ) {
167167 if ( e . keyCode == 32 ) {
168168 tField . value += tWords [ cWord ] ;
169169 cWord ++ ;
170170 }
171171 } ) ;
172172 // Change button colour to show that it has activated
173- document . getElementById ( " edu_answer" ) . children [ 0 ] . children [ 0 ] . getElementsByTagName ( " button" ) [ 0 ] . style = " color: #0F0;" ;
173+ document . getElementById ( ' edu_answer' ) . children [ 0 ] . children [ 0 ] . getElementsByTagName ( ' button' ) [ 0 ] . style = ' color: #0F0;' ;
174174}
175175// LiveChat Inc
176176function liveChatCheat ( ) {
177177 // Generate wordlist
178- tText = document . getElementsByClassName ( " test-prompt" ) [ 0 ] ;
178+ tText = document . getElementsByClassName ( ' test-prompt' ) [ 0 ] ;
179179 tWords = [ ] ;
180180 for ( let i = 0 ; i < tText . children . length ; i ++ ) {
181181 tWords . push ( tText . children [ i ] . innerText ) ;
182182 }
183183 // Cheat
184184 cWord = 0 ;
185- tField = document . getElementById ( " test-input" ) ;
186- tField . addEventListener ( " keydown" , function ( e ) {
185+ tField = document . getElementById ( ' test-input' ) ;
186+ tField . addEventListener ( ' keydown' , function ( e ) {
187187 if ( e . keyCode == 32 ) {
188188 tField . innerText = tWords [ cWord ] ;
189189 cWord ++ ;
@@ -194,114 +194,114 @@ function liveChatCheat() {
194194 }
195195 } ) ;
196196 // Change button colour to show that it has activated
197- document . getElementsByClassName ( " metrics" ) [ 1 ] . children [ 1 ] . style = " color: #0F0;" ;
197+ document . getElementsByClassName ( ' metrics' ) [ 1 ] . children [ 1 ] . style = ' color: #0F0;' ;
198198}
199199
200200// QuickTypingTest
201201function quickTypingCheat ( ) {
202202 // Generate wordlist
203- tText = document . querySelector ( " #text-display" ) ;
203+ tText = document . querySelector ( ' #text-display' ) ;
204204 tWords = [ ] ;
205- workWord = "" ;
205+ workWord = '' ;
206206 for ( let i = 0 ; i < tText . children . length ; i ++ ) {
207- workWord = "" ;
207+ workWord = '' ;
208208 for ( let j = 0 ; j < tText . children [ i ] . children . length ; j ++ ) {
209209 workWord += tText . children [ i ] . children [ j ] . innerText ;
210210 }
211211 tWords . push ( workWord ) ;
212212 }
213213 // Cheat
214214 cWord = 0 ;
215- tField = document . getElementById ( " text-input" ) ;
216- tField . addEventListener ( " keydown" , function ( e ) {
215+ tField = document . getElementById ( ' text-input' ) ;
216+ tField . addEventListener ( ' keydown' , function ( e ) {
217217 if ( e . keyCode == 32 ) {
218218 tField . value += tWords [ cWord ] ;
219219 cWord ++ ;
220220 }
221221 } ) ;
222222 // Change button colour to show that it has activated
223- document . getElementById ( " navbarResponsive" ) . children [ 0 ] . style = " width: 100%; color: #0F0;" ;
223+ document . getElementById ( ' navbarResponsive' ) . children [ 0 ] . style = ' width: 100%; color: #0F0;' ;
224224}
225225
226226// AOEU Typing Speed Test
227227function aoeuCheat ( ) {
228228 // Generate wordlist
229- tText = document . getElementById ( " words" ) ;
229+ tText = document . getElementById ( ' words' ) ;
230230 tWords = [ ] ;
231231 for ( let i = 0 ; i < tText . children . length ; i ++ ) {
232232 tWords . push ( tText . children [ i ] . innerText ) ;
233233 }
234234 // Cheat
235235 cWord = 0 ;
236- tField = document . getElementById ( " input" ) ;
237- tField . addEventListener ( " keyup" , function ( e ) {
236+ tField = document . getElementById ( ' input' ) ;
237+ tField . addEventListener ( ' keyup' , function ( e ) {
238238 if ( e . keyCode == 32 ) {
239239 tField . value = tWords [ cWord ] ;
240240 cWord ++ ;
241241 }
242242 } ) ;
243243 // Change button colour to show that it has activated
244- document . getElementById ( " score" ) . lastChild . style = " color: #0F0;" ;
244+ document . getElementById ( ' score' ) . lastChild . style = ' color: #0F0;' ;
245245}
246246
247247// India Typing
248248function indiaTypingCheat ( ) {
249249 // Generate wordlist
250- tText = document . getElementById ( " blockrandom" ) . contentDocument . getElementById ( " unicodeText" ) ;
250+ tText = document . getElementById ( ' blockrandom' ) . contentDocument . getElementById ( ' unicodeText' ) ;
251251 tWords = [ ] ;
252252 for ( let i = 0 ; i < tText . children . length ; i ++ ) {
253253 tWords . push ( tText . children [ i ] . innerText ) ;
254254 }
255255 // Cheat
256256 cWord = 0 ;
257- tField = document . getElementById ( " blockrandom" ) . contentDocument . getElementById ( " toType" ) ;
258- tField . addEventListener ( " keyup" , function ( e ) {
257+ tField = document . getElementById ( ' blockrandom' ) . contentDocument . getElementById ( ' toType' ) ;
258+ tField . addEventListener ( ' keyup' , function ( e ) {
259259 if ( e . keyCode == 32 ) {
260260 tField . value += tWords [ cWord ] ;
261261 cWord ++ ;
262262 }
263263 } ) ;
264264 // Change button colour to show that it has activated
265- document . getElementsByClassName ( " t3-sidebar" ) [ 0 ] . children [ 0 ] . style = " color: #0F0;" ;
265+ document . getElementsByClassName ( ' t3-sidebar' ) [ 0 ] . children [ 0 ] . style = ' color: #0F0;' ;
266266}
267267
268268// Cheat
269269switch ( site ) {
270270 // 10FastFingers (Normal)
271271 case 0 :
272272 // Create cheat button
273- document . getElementById ( " ads-speedtest-view-container" ) . innerHTML = " <button style=\" width: 100%;\" onclick=\" javascript:tenFastCheat();\" >Start TypeCheat</button>" ;
273+ document . getElementById ( ' ads-speedtest-view-container' ) . innerHTML = ' <button style=\' width: 100%;\' onclick=\' javascript:tenFastCheat();\' >Start TypeCheat</button>' ;
274274 break ;
275275 // TypeRacer
276276 case 1 :
277277 // Create cheat button
278- document . getElementsByClassName ( " navigation" ) [ 0 ] . innerHTML = " <button style=\" width: 100%;\" onclick=\" javascript:typeRacerCheat();\" >Start TypeCheat</button>" + document . getElementsByClassName ( " navigation" ) [ 0 ] . innerHTML ;
278+ document . getElementsByClassName ( ' navigation' ) [ 0 ] . innerHTML = ' <button style=\' width: 100%;\' onclick=\' javascript:typeRacerCheat();\' >Start TypeCheat</button>' + document . getElementsByClassName ( ' navigation' ) [ 0 ] . innerHTML ;
279279 break ;
280280 // TypingTestNow
281281 case 2 :
282282 // Create cheat button
283- document . getElementsByClassName ( " row" ) [ 0 ] . innerHTML = " <button style=\" width: 100%;\" onclick=\" javascript:typingTestNowCheat();\" >Start TypeCheat</button>"
283+ document . getElementsByClassName ( ' row' ) [ 0 ] . innerHTML = ' <button style=\' width: 100%;\' onclick=\' javascript:typingTestNowCheat();\' >Start TypeCheat</button>'
284284 break ;
285285 // Bing Typing Test
286286 case 3 :
287287 // Create cheat button
288- document . getElementById ( " edu_answer" ) . children [ 0 ] . children [ 0 ] . innerHTML += " <button onclick=\" javascript:bingCheat();\" >Start TypeCheat</button>" ;
288+ document . getElementById ( ' edu_answer' ) . children [ 0 ] . children [ 0 ] . innerHTML += ' <button onclick=\' javascript:bingCheat();\' >Start TypeCheat</button>' ;
289289 break ;
290290 // LiveCheat Inc
291291 case 4 :
292292 // Create cheat button
293- document . getElementsByClassName ( " metrics" ) [ 1 ] . innerHTML += " <button onclick=\" javascript:liveChatCheat();\" >Start TypeCheat</button>" ;
293+ document . getElementsByClassName ( ' metrics' ) [ 1 ] . innerHTML += ' <button onclick=\' javascript:liveChatCheat();\' >Start TypeCheat</button>' ;
294294 break ;
295295 // QuickTypingTest
296296 case 5 :
297- document . getElementById ( " navbarResponsive" ) . innerHTML = " <button style=\" width: 100%;\" onclick=\" javascript:quickTypingCheat();\" >Start TypeCheat</button>" + document . getElementById ( " navbarResponsive" ) . innerHTML ;
297+ document . getElementById ( ' navbarResponsive' ) . innerHTML = ' <button style=\' width: 100%;\' onclick=\' javascript:quickTypingCheat();\' >Start TypeCheat</button>' + document . getElementById ( ' navbarResponsive' ) . innerHTML ;
298298 break ;
299299 // AOEU Typing Speed Test
300300 case 6 :
301- document . getElementById ( " score" ) . innerHTML += " <button onclick=\" javascript:aoeuCheat();\" >Start TypeCheat</button>" ;
301+ document . getElementById ( ' score' ) . innerHTML += ' <button onclick=\' javascript:aoeuCheat();\' >Start TypeCheat</button>' ;
302302 break ;
303303 // India Typing
304304 case 7 :
305- document . getElementsByClassName ( " t3-sidebar" ) [ 0 ] . innerHTML = " <button onclick=\" javascript:indiaTypingCheat();\" >Start TypeCheat</button>" ;
305+ document . getElementsByClassName ( ' t3-sidebar' ) [ 0 ] . innerHTML = ' <button onclick=\' javascript:indiaTypingCheat();\' >Start TypeCheat</button>' ;
306306 break ;
307307}
0 commit comments