Skip to content

Commit fe96409

Browse files
committed
fix
1 parent 35bb21a commit fe96409

File tree

9 files changed

+154
-181
lines changed

9 files changed

+154
-181
lines changed

popup/helpers/category.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,13 +109,6 @@ export const CATEGORY = {
109109
vi: `<i class="fa-solid fa-robot"></i> Tự động hoá`,
110110
},
111111
},
112-
password: {
113-
id: "password",
114-
name: {
115-
en: `<i class="fa-solid fa-key"></i> Password`,
116-
vi: `<i class="fa-solid fa-key"></i> Mật khẩu`,
117-
},
118-
},
119112
unlock: {
120113
id: "unlock",
121114
name: {

popup/popup.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ <h3>
2020
<p>Make with <i class="fa-solid fa-heart fa-beat" style="color:#ff0000a3"></i>
2121
by <a target="_blank" href="https://github.com/HoangTran0410">Hoang Tran</a></p>
2222
</h3>
23-
<br />
2423

2524
<!-- Tab links -->
2625
<div class="tab">

popup/styles/style.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ a:hover {
324324
visibility: visible;
325325
top: 105%;
326326
opacity: 1;
327-
transition: all .3s linear .7s;
327+
transition: all .3s linear .3s;
328328
}
329329

330330
.tooltip .tooltiptext::after {

popup/tabs.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,13 @@ const tabs = [
195195
{
196196
...CATEGORY.automation,
197197
scripts: [
198+
s.shortenURL,
199+
s.unshorten,
198200
createTitle("--- QRCode ---", "--- QRCode ---"),
199201
s.textToQRCode,
200202
s.webToQRCode,
201203
createTitle("--- Auto ---", "--- Tự động ---"),
204+
s.passwordGenerator,
202205
s.getAllEmailsInWeb,
203206
s.screenshotFullPage,
204207
s.jsonformatter,
@@ -215,22 +218,19 @@ const tabs = [
215218
s.transfer_sh,
216219
],
217220
},
218-
{
219-
...CATEGORY.password,
220-
scripts: [s.passwordGenerator, s.passwordFieldToggle],
221-
},
222221
{
223222
...CATEGORY.unlock,
224223
scripts: [
224+
createTitle("--- Unlock web ---", "--- Mở khoá web ---"),
225225
s.donotBlockMe,
226-
s.shortenURL,
227-
s.unshorten,
226+
s.envato_bypassPreview,
227+
s.studyphim_unlimited,
228+
s.studocu_bypassPreview,
229+
createTitle("--- Unlock function ---", "--- Mở khoá chức năng ---"),
228230
s.simpleAllowCopy,
229231
s.reEnableContextMenu,
230232
s.showHiddenFields,
231-
s.studyphim_unlimited,
232-
s.studocu_bypassPreview,
233-
s.envato_bypassPreview,
233+
s.passwordFieldToggle,
234234
s.viewCookies,
235235
s.removeCookies,
236236
s.viewBrowserInfo,

scripts/content-scripts/document_start.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,6 @@
6464
break;
6565
}
6666
});
67-
68-
// https://stackoverflow.com/a/53033388
69-
const { getURL, injectScript, injectCss } = await import("./utils.js");
70-
injectScript(getURL("content-scripts/scripts/useful-scripts-utils.js"));
7167
} catch (e) {
7268
console.log("ERROR: ", e);
7369
}

scripts/content-scripts/scripts/mp3.zing.vn.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

scripts/content-scripts/scripts/ufs_global_webpage_context.js

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,149 @@ const UsefulScriptGlobalWebpageContext = {
6666
};
6767
window.UsefulScriptGlobalWebpageContext = UsefulScriptGlobalWebpageContext;
6868

69+
// Chứa các hàm hỗ trợ việc hack web :))
70+
const UsefulScriptsUtils = {
71+
// Có trang web tự động xoá console để ngăn cản người dùng xem kết quả thực thi câu lệnh trong console
72+
// Ví dụ: https://beta.nhaccuatui.com/
73+
// Hàm này sẽ tắt chức năng tự động clear console đó, giúp hacker dễ hack hơn :)
74+
disableAutoConsoleClear() {
75+
window.console.clear = () => null;
76+
console.log("Auto console.clear DISABLED!");
77+
},
78+
79+
// Hiển thị tất cả các biến toàn cục được tạo ra trong trang web
80+
// https://mmazzarolo.com/blog/2022-02-14-find-what-javascript-variables-are-leaking-into-the-global-scope/
81+
listGlobalVariables() {
82+
let browserGlobals = [];
83+
const ignoredGlobals = ["UsefulScriptsUtils"];
84+
85+
function collectBrowserGlobals() {
86+
const iframe = window.document.createElement("iframe");
87+
iframe.src = "about:blank";
88+
window.document.body.appendChild(iframe);
89+
let globals = Object.keys(iframe.contentWindow);
90+
window.document.body.removeChild(iframe);
91+
return globals;
92+
}
93+
94+
function getRuntimeGlobals() {
95+
if (browserGlobals.length === 0) {
96+
browserGlobals = collectBrowserGlobals();
97+
}
98+
const runtimeGlobals = Object.keys(window).filter(
99+
(key) => !ignoredGlobals.includes(key) && !browserGlobals.includes(key)
100+
);
101+
const runtimeGlobalsObj = {};
102+
runtimeGlobals.forEach((key, i) => {
103+
runtimeGlobalsObj[key] = window[key];
104+
});
105+
return runtimeGlobalsObj;
106+
}
107+
108+
return getRuntimeGlobals();
109+
},
110+
111+
// https://mmazzarolo.com/blog/2022-07-30-checking-if-a-javascript-native-function-was-monkey-patched/
112+
// Kiểm tra xem function nào đó có bị override hay chưa
113+
isNativeFunction(f) {
114+
return f.toString().toString().includes("[native code]");
115+
},
116+
117+
// https://mmazzarolo.com/blog/2022-06-26-filling-local-storage-programmatically/
118+
// Làm đầy localStorage
119+
fillLocalStorage() {
120+
const key = "__filling_localstorage__";
121+
let max = 1;
122+
let data = "x";
123+
try {
124+
while (true) {
125+
data = data + data;
126+
localStorage.setItem(key, data);
127+
max <<= 1;
128+
}
129+
} catch {}
130+
for (let bit = max >> 1; bit > 0; bit >>= 1) {
131+
try {
132+
localStorage.setItem(key, data.substring(0, max | bit));
133+
max |= bit;
134+
} catch {
135+
console.success("Storage is now completely full 🍟");
136+
}
137+
}
138+
return function cleanup() {
139+
localStorage.removeItem(key);
140+
console.success("Storage is cleaned");
141+
};
142+
},
143+
144+
// https://mmazzarolo.com/blog/2022-02-16-track-down-the-javascript-code-responsible-for-polluting-the-global-scope/
145+
globalsDebugger(varName = "") {
146+
// https://stackoverflow.com/a/56933091/11898496
147+
const urlParams = new URLSearchParams(window.location.search);
148+
urlParams.set("globalsToInspect", varName);
149+
window.location.search = urlParams.toString();
150+
},
151+
152+
// Tìm chuỗi xung quanh chuỗi bất kỳ
153+
// Ví dụ fullString = "abcd1234567890abcd" targetString = "6" bound = 3
154+
// => Kết quả around = 3456789
155+
getTextAround(fullString, targetString, bound = 10) {
156+
let curIndex = 0;
157+
let arounds = [];
158+
let limit = 100;
159+
160+
while (limit) {
161+
let index = fullString.indexOf(targetString, curIndex);
162+
if (index === -1) break;
163+
164+
let around = fullString.slice(
165+
Math.max(index - Math.floor(bound / 2) - 1, 0),
166+
Math.min(
167+
index + targetString.length + Math.floor(bound / 2),
168+
fullString.length
169+
)
170+
);
171+
arounds.push({ index, around });
172+
curIndex = index + (targetString.length || 1);
173+
limit--;
174+
}
175+
return arounds;
176+
},
177+
178+
// https://stackoverflow.com/a/40410744/11898496
179+
// Giải mã từ dạng 'http\\u00253A\\u00252F\\u00252Fexample.com' về 'http://example.com'
180+
decodeEscapedUnicodeString(str) {
181+
return decodeURIComponent(
182+
JSON.parse('"' + str.replace(/\"/g, '\\"') + '"')
183+
);
184+
},
185+
186+
// https://stackoverflow.com/a/8649003
187+
searchParamsToObject(search) {
188+
// let d = {};
189+
// decodeURI(search)
190+
// .split("&")
191+
// .map((_) => _.split("="))
192+
// .forEach((_) => (d[_[0]] = _[1]));
193+
// return d;
194+
195+
search = search || location.search.substring(1);
196+
return JSON.parse(
197+
'{"' + search.replace(/&/g, '","').replace(/=/g, '":"') + '"}',
198+
function (key, value) {
199+
return key === "" ? value : decodeURIComponent(value);
200+
}
201+
);
202+
},
203+
};
204+
window.UsefulScriptsUtils = UsefulScriptsUtils;
205+
69206
// ================================= Polyfill =================================
70207
// Chrome pre-34
71208
if (!Element.prototype.matches)
72209
Element.prototype.matches = Element.prototype.webkitMatchesSelector;
210+
211+
// https://mmazzarolo.com/blog/2022-08-25-simple-colored-logging-for-javascript-clis/
212+
window.console.success = (...args) => console.log("\x1b[32m✔\x1b[0m", ...args);
213+
window.console.failure = (...args) =>
214+
console.error("\x1b[31mx\x1b[0m", ...args);

scripts/content-scripts/scripts/useful-scripts-utils.js

Lines changed: 0 additions & 139 deletions
This file was deleted.

0 commit comments

Comments
 (0)