Skip to content

Commit 0b9f6d7

Browse files
committed
hard work - snaptik
1 parent 757847d commit 0b9f6d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+510
-191
lines changed

net-request-rules/rules.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"type": "modifyHeaders",
77
"requestHeaders": [
88
{
9-
"header": "Referer",
9+
"header": "referer",
1010
"operation": "set",
1111
"value": "https://unshorten.it/"
1212
},

popup/helpers/category.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ export const CATEGORY = {
8282
vi: `<i class="fa-brands fa-youtube"></i> Youtube`,
8383
},
8484
},
85+
tiktok: {
86+
id: "tiktok",
87+
name: {
88+
en: `<i class="fa-brands fa-tiktok"></i> Tiktok`,
89+
vi: `<i class="fa-brands fa-tiktok"></i> Tiktok`,
90+
},
91+
},
8592
github: {
8693
id: "github",
8794
name: {

popup/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ async function runScript(script) {
271271

272272
function initOpenInNewTabBtn() {
273273
if (isExtensionInSeperatedPopup()) {
274+
document.title = "Useful Scripts";
274275
openInNewTabBtn.remove();
275276
} else {
276277
openInNewTabBtn.onclick = () => {

popup/popup.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ <h3>
3131
</div>
3232

3333
<!-- language flag -->
34-
<img id="flag" src="" alt="">
34+
<img id="flag" src="" alt="" title="Change language">
3535

36-
<button id="open-in-new-tab">
36+
<button id="open-in-new-tab" title="Open in new popup">
3737
<i class="fa-solid fa-up-right-from-square"></i>
3838
</button>
3939

popup/tabs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ const tabs = [
133133
s.youtube_popupPlayer,
134134
],
135135
},
136+
{
137+
...CATEGORY.tiktok,
138+
scripts: [s.tiktok_downloadVideo],
139+
},
136140
{
137141
...CATEGORY.github,
138142
scripts: [s.github_goToFirstCommit, s.githubdev, s.github1s],
@@ -153,7 +157,6 @@ const tabs = [
153157
s.webToQRCode,
154158
s.getAllEmailsInWeb,
155159
s.screenshotFullPage,
156-
s.screenshotAreaPage,
157160
s.webToPDF,
158161
s.transfer_sh,
159162
s.jsonformatter,
@@ -174,6 +177,7 @@ const tabs = [
174177
scripts: [
175178
s.shortenURL,
176179
s.unshorten,
180+
s.viewBrowserInfo,
177181
s.showHiddenFields,
178182
s.viewCookies,
179183
s.removeCookies,

scripts/archiveToday.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ export default {
1515
func: async function () {
1616
let { url } = await getCurrentTab();
1717

18-
var a = window.prompt(
19-
"Nhập URL muốn xem archive: ",
18+
var a = prompt(
19+
"Nhập URL muốn tạo archive: ",
2020
url.replace(/^http\:\/\/(.*)$/, "$1")
2121
);
22-
window.open("https://archive.today/?run=1&url=" + encodeURIComponent(a));
22+
if (a != null) {
23+
window.open("https://archive.today/?run=1&url=" + encodeURIComponent(a));
24+
}
2325
},
2426
};

scripts/download_image.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ export default {
112112
win.document.body.innerHTML = html;
113113
}
114114

115-
const mode = window.prompt(
115+
const mode = prompt(
116116
"Choose mode:\n\n- 1: Download current image (in viewport)\n- 2: Download all images",
117117
1
118118
);

scripts/fb_checkToken.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export default {
1111
runInExtensionContext: true,
1212

1313
func: function () {
14-
let token = window.prompt(
14+
let token = prompt(
1515
"Enter accesstoken want to check\nNhập access token muốn kiểm tra:",
1616
""
1717
);

scripts/fb_getAlbumId.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ export default {
1818
for (let a of [location, ...Array.from(list_a)]) {
1919
const page_album_id = /(?<=\/photos\/a\.)(.\d+?)(?=\/)/.exec(a.href);
2020
if (page_album_id && page_album_id[0]) {
21-
window.prompt("PAGE ALBUM ID:", page_album_id[0]);
21+
prompt("PAGE ALBUM ID:", page_album_id[0]);
2222
return;
2323
}
2424
const group_album_id = /(?<=set\=oa\.)(.\d+?)($|(?=&))/.exec(a.href);
2525
if (group_album_id && group_album_id[0]) {
26-
window.prompt("GROUP ALBUM ID:", group_album_id[0]);
26+
prompt("GROUP ALBUM ID:", group_album_id[0]);
2727
return;
2828
}
2929
const user_album_id = /(?<=set\=a\.)(.\d+?)($|(?=&))/.exec(a.href);
3030
if (user_album_id && user_album_id[0]) {
31-
window.prompt("USER ALBUM ID:", user_album_id[0]);
31+
prompt("USER ALBUM ID:", user_album_id[0]);
3232
return;
3333
}
3434
}
35-
window.prompt(
35+
prompt(
3636
"Không tìm thấy ALBUM ID nào trong trang web!\nBạn có đang ở đúng trang album chưa?\nTrang web Ví dụ:",
3737
"https://www.facebook.com/media/set/?vanity=ColourfulSpace&set=a.945632905514659"
3838
);

scripts/fb_getAllAlbumId.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ export default {
3232
// filter duplicate: https://stackoverflow.com/a/14438954
3333
list_id = [...new Set(list_id)];
3434
if (list_id.length)
35-
window.prompt(
35+
prompt(
3636
`Tìm thấy ${list_id.length} album id trong trang web và trên url.`,
3737
list_id.join(", ")
3838
);
3939
else
40-
window.prompt(
40+
prompt(
4141
"Không tìm thấy ALBUM ID nào trong trang web!\nBạn có đang ở đúng trang album chưa?\nTrang web Ví dụ:",
4242
"https://www.facebook.com/media/set/?vanity=ColourfulSpace&set=a.945632905514659"
4343
);

scripts/fb_getAllUidFromFbSearch.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default {
4242
console.log(name, uid);
4343
}
4444
console.log(uids);
45-
window.prompt("Tất cả UID: ", uids.join("\n"));
45+
prompt("Tất cả UID: ", uids.join("\n"));
4646
};
4747
main();
4848
},

scripts/fb_getAllUidFromFriendsPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default {
4848
console.log(name, uid);
4949
}
5050
console.log(uids);
51-
window.prompt("Tất cả UID: ", uids.join("\n"));
51+
prompt("Tất cả UID: ", uids.join("\n"));
5252
},
5353
};
5454

scripts/fb_getAllVideoId.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ export default {
2020
}
2121
}
2222
if (list_id.length)
23-
window.prompt(
23+
prompt(
2424
`Tìm thấy ${list_id.length} video id: `,
2525
list_id.join(", ")
2626
);
2727
else
28-
window.prompt(
28+
prompt(
2929
"Không tìm thấy video id nào trong trang web!\nBạn có ở đúng trang video chưa?\nTrang web ví dụ:",
3030
"https://www.facebook.com/watch/?ref=tab"
3131
);

scripts/fb_getGroupId.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default {
1616
const group_name = document.title;
1717
const found = (check) => {
1818
if (check && check[0]) {
19-
window.prompt(`GROUP ID của ${group_name}:`, check[0]);
19+
prompt(`GROUP ID của ${group_name}:`, check[0]);
2020
return true;
2121
}
2222
return false;
@@ -27,7 +27,7 @@ export default {
2727
for (let a of Array.from(list_a)) {
2828
if (found(/(?<=\/groups\/)(.\d+?)(?=\/user\/)/.exec(a.href))) return;
2929
}
30-
window.prompt(
30+
prompt(
3131
"Không tìm thấy GROUP ID nào trong trang web!\nBạn có đang ở đúng trang group chưa?\nTrang web Ví dụ:",
3232
"https://www.facebook.com/groups/j2team.community.girls"
3333
);

scripts/fb_getPageId.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export default {
1616
const page_name = document.title;
1717
const found = (check) => {
1818
if (check && check[0]) {
19-
window.prompt(`PAGE ID của ${page_name}:`, check[0]);
19+
prompt(`PAGE ID của ${page_name}:`, check[0]);
2020
return true;
2121
}
2222
return false;
@@ -25,7 +25,7 @@ export default {
2525
return;
2626
if (found(/(?<=facebook\.com\/)(.*?)($|(?=\/)|(?=&))/.exec(location.href)))
2727
return;
28-
window.prompt(
28+
prompt(
2929
"Không tìm thấy PAGE ID nào trong url!\nBạn có đang ở đúng trang page fb chưa?\nTrang web Ví dụ:",
3030
"https://www.facebook.com/ColourfulSpace"
3131
);

scripts/fb_getTimelineAlbumId.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export default {
1818
for (let a of Array.from(list_a)) {
1919
const posts_screen = /(?<=set\=a\.)(.\d+?)(?=\&__cft__)/.exec(a.href);
2020
if (posts_screen && posts_screen[0]) {
21-
window.prompt(
21+
prompt(
2222
`Timeline Album ID của ${page_name}:\n` +
2323
"- Bấm OK để mở album trong tab mới. Cancel để huỷ -",
2424
posts_screen[0]

scripts/fb_getTokenBusinessStudio.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export default {
1919
// try {
2020
// const accessToken =
2121
// "EAA" + /(?<=EAA)(.*?)(?=\")/.exec(document.body.textContent)[0];
22-
// window.prompt("Access Token của bạn:", accessToken);
22+
// prompt("Access Token của bạn:", accessToken);
2323
// } catch (e) {
2424
// alert("LỖI: " + e.message);
2525
// }

scripts/fb_getTokenCampaigns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default {
5555
const { closeLoading } = showLoading("Đang lấy access token...");
5656
let token = await getToken();
5757
if (token) {
58-
window.prompt("Access token: ", token);
58+
prompt("Access token: ", token);
5959
} else {
6060
alert("Không tìm thấy access token");
6161
}

scripts/fb_getTokenLocmai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ export default {
117117
};
118118

119119
(async () => {
120-
let user = window.prompt("Enter username:", "");
120+
let user = prompt("Enter username:", "");
121121
if (user) {
122-
let pass = window.prompt("Enter password:", "");
122+
let pass = prompt("Enter password:", "");
123123
if (pass) {
124124
token.getToken(user, pass);
125125
}

scripts/fb_getTokenMFacebook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default {
2727
};
2828
console.log(data);
2929
if (data.token) {
30-
window.prompt("Access Token của bạn:", data.token);
30+
prompt("Access Token của bạn:", data.token);
3131
} else {
3232
alert("Không tìm thấy access token");
3333
}

scripts/fb_getUid.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ export default {
3636
/(?<=\"user\"\:\{\"id\"\:\")(.\d+?)(?=\")/.exec(document.body.innerHTML)
3737
);
3838

39-
if (uid) window.prompt(`USER ID của ${document.title}:`, uid);
39+
if (uid) prompt(`USER ID của ${document.title}:`, uid);
4040
else
41-
window.prompt(
41+
prompt(
4242
"Không tìm thấy USER ID nào trong trang web!\nBạn có đang ở đúng trang profile chưa?\nTrang web Ví dụ: ",
4343
"https://www.facebook.com/callchoulnhe"
4444
);

scripts/fb_getUidFromUrl.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ export default {
2525
}
2626
return null;
2727
};
28-
const url = window.prompt("Nhập url của user fb:", "");
28+
const url = prompt("Nhập url của user fb:", "");
2929
if (url) {
3030
const { closeLoading } = showLoading("Đang lấy UID của " + url);
3131
_getUidFromUrl(url)
3232
.then((uid) => {
33-
if (uid) window.prompt(`UID của user ${url}:`, uid);
33+
if (uid) prompt(`UID của user ${url}:`, uid);
3434
else alert("Không tìm thấy uid của user!");
3535
})
3636
.catch((err) => alert("Lỗi: " + err.message))

scripts/getLinkLuanxt.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default {
140140
};
141141

142142
(async () => {
143-
let url = window.prompt(
143+
let url = prompt(
144144
"Hỗ trợ:\n+ " +
145145
[
146146
"Zing MP3, Zing Video Clip, Zing TV",
@@ -176,7 +176,10 @@ export default {
176176
renderResult(json, win);
177177
}
178178
} catch (e) {
179-
alert("ERROR: " + e);
179+
prompt(
180+
"ERROR: " + e + "\n\nBạn có thể mở trang web bên dưới để thử lại:",
181+
apiBaseURL
182+
);
180183
} finally {
181184
closeLoading();
182185
}

scripts/googleCache.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export default {
1717
// https://cachedviews.com/
1818

1919
let { url } = await getCurrentTab();
20-
let url_to_check = window.prompt(
20+
let url_to_check = prompt(
2121
"Nhập URL muốn xem cache: ",
2222
url.replace(/^http\:\/\/(.*)$/, "$1")
2323
);

scripts/googleShortcuts.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default {
2222
["Google Calendar", "https://calendar.new"],
2323
];
2424

25-
let option = window.prompt(
25+
let option = prompt(
2626
"Create new:\n\n" +
2727
urls.map(([name, url], index) => `- ${index}: ${name}\n`).join(""),
2828
0

0 commit comments

Comments
 (0)