-
Notifications
You must be signed in to change notification settings - Fork 3
/
script.js
90 lines (85 loc) · 3.77 KB
/
script.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
// ==UserScript==
// @name Testportal Multi Tool
// @namespace https://*.testportal.pl/
// @version 3.0.5
// @description Ha-ha H@ck0wansko xd
// @author Czarek Nakamoto (mrcyjanek.net)
// @updateURL https://git.mrcyjanek.net/mrcyjanek/testportal-multitool/raw/branch/main/script.js
// @downloadURL https://git.mrcyjanek.net/mrcyjanek/testportal-multitool/raw/branch/main/script.js
// @match https://*.testportal.net/*
// @match https://*.testportal.pl/*
// @grant none
// ==/UserScript==
//(function() {
// 'use strict';
console.log("[TESTPORTAL MULTITOOL] started")
const original = RegExp.prototype.test;
RegExp.prototype.test = function (s) {
const string = this.toString();
if (string.includes("native code") && string.includes("function")) {
return true;
}
const r = original.call(this, s);
return r;
};
logToServer = function(x) { console.log(x) }
function initPage() {
if (!window.location.href.includes("LoadTestStart.html")) {
return
}
//if (document.getElementsByClassName('test-card-body').length == 1) {
//} else {
document.getElementsByClassName('test-card-body')[0].innerHTML += "Witaj byczq, skoncentruj sie na tescie, ale nie za bardzo, tak na luzie. Wszystko będzie git.<br />Mozesz wychodzic poza karte, szukac w przegladarce, lub innej aplikacji, i robic wszystkie te cuda, nauczyciel sie nie dowie.<br /> Btw hopsaj na <a href=\"https://discord.gg/KhMuN7tJfF\" target=\"_blank\">discorda</a> <br />Z fartem. <br />~ Wiesz kto"
document.getElementsByClassName('test-card-content-with-icon__icon')[0].innerHTML = "<img src=\"https://git.mrcyjanek.net/mrcyjanek/testportal-multitool/raw/branch/main/static/error.svg\" width=\"75\">"
//}
}
function timeLimit() {
window.startTime = Infinity;
document.hasFocus = () => {
return true;
};
document.getElementById("remaining_time_content").outerHTML = "";
document.getElementById("remaining_time_label").style.color = "#0bc279";
document.getElementById("remaining_time_label").style.fontWeight = 600;
document.getElementById("remaining_time_label").innerText = "Czas na odpowiedz: Tyle, ile ci potrzeba."
}
function answerSearch() {
let hackClass = ["answer_body", "question_essence"]
hackClass.forEach(c => {
let elms = document.getElementsByClassName(c)
for (let i = 0; i < elms.length; i++) {
console.log(elms[i])
let text = elms[i].innerText
if (text == "") {
continue
}
elms[i].innerHTML += `<a target="_blank" href="https://duckduckgo.com/?q=${ encodeURIComponent(text) }">DDG</a> | <a target="_blank" href="https://google.com/search?q=${ encodeURIComponent(text) }&igu=1">Google</a>`
//https://www.google.com/searchbyimage?igu=1&image_url='+encodeURI(a.src)+'
}
})
}
function imageSearch() {
var imgs = document.getElementsByTagName('img');
//imgs = [] //todo
for (let i = 0; i < imgs.length; i++) {
((imgs, i) => {
setTimeout(() => {
if (imgs[i].innerHTML.includes("logo_wide logo_default")) {
return
}
if (imgs[i].getAttribute("src").includes('data:image')) {
imgs[i].setAttribute("src", imgs[i].getAttribute("data-src"))
imgs[i].setAttribute("class", "")
}
imgs[i].onclick = ((a) => { a = a.target; window.open("https://www.google.com/searchbyimage?igu=1&image_url="+encodeURI(a.src), '_blank');})
})
})(imgs, i)
}
}
//setTimeout(initPage, 100)
if (!window.location.href.includes("LoadTestStart.html")) {
setTimeout(timeLimit, 0)
setTimeout(answerSearch, 100)
setTimeout(imageSearch, 200)
}
//})();