Skip to content

Commit 223b185

Browse files
committed
update
1 parent 7242baa commit 223b185

16 files changed

+307
-151
lines changed

popup/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ function createScriptButton(script, isFavorite = false) {
195195
const { text, color, backgroundColor } = badge;
196196
const badgeItem = document.createElement("span");
197197
badgeItem.classList.add("badge");
198-
badgeItem.innerText = t(text);
198+
badgeItem.innerHTML = t(text);
199199
badgeItem.style.color = color;
200200
badgeItem.style.backgroundColor = backgroundColor;
201201

popup/tabs.js

Lines changed: 90 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -29,28 +29,30 @@ const tabs = [
2929
{
3030
...CATEGORY.search,
3131
scripts: [
32-
s._test,
33-
s._ufs_statistic,
34-
{
35-
id: "recommend_search_userscript",
36-
icon: "https://www.userscript.zone/favicon.ico",
37-
name: {
38-
en: "Search Userscripts",
39-
vi: "Tìm Userscripts",
40-
},
41-
description: {
42-
en: "Search Userscripts on Usersript.zone",
43-
vi: "Tìm Userscripts trên Usersript.zone",
44-
},
45-
46-
onClickExtension: function () {
47-
window.open("https://www.userscript.zone/");
48-
},
49-
},
50-
s.whatFont,
32+
// s._test,
33+
// s._ufs_statistic,
5134
s.similarWeb,
35+
s.similarWeb_bypassLimit,
5236
s.search_sharedAccount,
53-
s.whatWebsiteStack,
37+
addBadge(
38+
{
39+
id: "recommend_wappalyzer",
40+
icon: "https://www.wappalyzer.com/favicon.ico",
41+
name: {
42+
en: "Wappalyzer - view website stacks",
43+
vi: "Wappalyzer - Web dùng công nghệ gì?",
44+
},
45+
description: {
46+
en: "Technology that current website is using",
47+
vi: "Xem những công nghệ/thư viện trang web đang dùng",
48+
},
49+
50+
onClickExtension: function () {
51+
window.open("https://www.wappalyzer.com/apps/");
52+
},
53+
},
54+
BADGES.recommend
55+
),
5456
s.whois,
5557
s.viewWebMetaInfo,
5658
{
@@ -73,6 +75,22 @@ const tabs = [
7375
s.downDetector,
7476
s.openWaybackUrl,
7577
s.archiveToday,
78+
{
79+
id: "recommend_search_userscript",
80+
icon: "https://www.userscript.zone/favicon.ico",
81+
name: {
82+
en: "Search Userscripts",
83+
vi: "Tìm Userscripts",
84+
},
85+
description: {
86+
en: "Search Userscripts on Usersript.zone",
87+
vi: "Tìm Userscripts trên Usersript.zone",
88+
},
89+
90+
onClickExtension: function () {
91+
window.open("https://www.userscript.zone/");
92+
},
93+
},
7694
],
7795
},
7896
{
@@ -82,7 +100,7 @@ const tabs = [
82100
s.saveAllVideo,
83101
s.vuiz_getLink,
84102
s.savevideo_me,
85-
{
103+
addBadge({
86104
id: "getLinkLuanxt_newtab",
87105
icon: "https://luanxt.com/get-link-mp3-320-lossless-vip-zing/favicon.ico",
88106
name: {
@@ -96,17 +114,19 @@ const tabs = [
96114
infoLink: "https://luanxt.com/get-link-mp3-320-lossless-vip-zing/",
97115
onClickExtension: () =>
98116
window.open("https://luanxt.com/get-link-mp3-320-lossless-vip-zing/"),
99-
},
100-
s.bookmark_exporter,
101-
s.twitter_downloadButton,
117+
}),
102118
createTitle("--- Photos ---", "--- Ảnh ---"),
119+
s.magnify_image,
120+
s.auto_redirectLargestImageSrc,
121+
s.twitter_downloadButton,
122+
s.getFavicon,
103123
addBadge(
104124
{
105125
id: "recommend_picviewer_ce+",
106126
icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAMAAADXqc3KAAAAV1BMVEUAAAD////29vbKysoqKioiIiKysrKhoaGTk5N9fX3z8/Pv7+/r6+vk5OTb29vOzs6Ojo5UVFQzMzMZGRkREREMDAy4uLisrKylpaV4eHhkZGRPT08/Pz/IfxjQAAAAgklEQVQoz53RRw7DIBBAUb5pxr2m3/+ckfDImwyJlL9DDzQgDIUMRu1vWOxTBdeM+onApENF0qHjpkOk2VTwLVEF40Kbfj1wK8AVu2pQA1aBBYDHJ1wy9Cf4cXD5chzNAvsAnc8TjoLAhIzsBao9w1rlVTIvkOYMd9nm6xPi168t9AYkbANdajpjcwAAAABJRU5ErkJggg==",
107127
name: {
108-
en: "Picviewer CE+",
109-
vi: "Picviewer CE+",
128+
en: "Picviewer CE+ download images",
129+
vi: "Picviewer CE+ tải ảnh",
110130
},
111131
description: {
112132
en: "Powerful picture viewing tool online, which can popup/scale/rotate/batch save pictures automatically",
@@ -118,7 +138,39 @@ const tabs = [
118138
},
119139
BADGES.recommend
120140
),
121-
s.getFavicon,
141+
addBadge(
142+
{
143+
id: "recommend_file_converter",
144+
icon: "https://file-converter.io/favicon.ico",
145+
name: {
146+
en: "File-converter.io - change image type",
147+
vi: "File-converter.io - chuyển đổi ảnh",
148+
},
149+
description: {
150+
en: "Powerful tool which allows you to convert and compress files using the context menu in windows explorer.",
151+
vi: "Công cụ nén ảnh, đổi định dạng ảnh hàng loạt, trực tiếp bằng chuột phải.",
152+
img: "https://file-converter.io/images/file-converter-usage.gif",
153+
},
154+
onClickExtension: () => window.open("https://file-converter.io/"),
155+
},
156+
BADGES.recommend
157+
),
158+
addBadge(
159+
{
160+
id: "recommend_squoosh_app",
161+
icon: "https://squoosh.app/c/icon-large-maskable-c2078ced.png",
162+
name: {
163+
en: "Squoosh.app - compress images",
164+
vi: "Squoosh.app - nén ảnh",
165+
},
166+
description: {
167+
en: "Make images smaller using best-in-class codecs, right in the browser.",
168+
vi: "Công cụ nén ảnh mạnh mẽ, giảm kích thước ngay trên trình duyệt",
169+
},
170+
onClickExtension: () => window.open("https://squoosh.app/"),
171+
},
172+
BADGES.recommend
173+
),
122174
createTitle("--- Music ---", "--- Nhạc ---"),
123175
s.spotify_downloadButton,
124176
s.soundcloud_downloadMusic,
@@ -130,6 +182,7 @@ const tabs = [
130182
s.vimeo_downloader,
131183
s.showTheVideos,
132184
createTitle("--- Document ---", "--- Tài liệu ---"),
185+
s.bookmark_exporter,
133186
s.tailieu_vn,
134187
s.docDownloader,
135188
s.scribd_downloadDocuments,
@@ -308,8 +361,6 @@ const tabs = [
308361
...CATEGORY.automation,
309362
scripts: [
310363
createTitle("--- Utility ---", "--- Tiện ích ---"),
311-
s.magnify_image,
312-
s.auto_redirectLargestImageSrc,
313364
s.textToQrCode,
314365
s.shortenURL,
315366
s.unshorten,
@@ -442,7 +493,7 @@ const tabs = [
442493
);
443494
},
444495
},
445-
{
496+
addBadge({
446497
id: "recommend_leakCheck",
447498
icon: "https://leakcheck.io/favicon.ico",
448499
name: {
@@ -458,7 +509,7 @@ const tabs = [
458509
onClickExtension: () => {
459510
window.open("https://okela.fun/");
460511
},
461-
},
512+
}),
462513
],
463514
},
464515
{
@@ -487,6 +538,7 @@ const tabs = [
487538
},
488539
BADGES.recommend
489540
),
541+
s.whatFont,
490542
s.visualEvent,
491543
s.listAllImagesInWeb,
492544
s.viewAllLinks,
@@ -724,6 +776,11 @@ function sortScriptsByTab(scripts, _tabs, addTabTitle = true) {
724776
return result;
725777
}
726778

779+
const allScriptInTabs = [
780+
...tabs.map((tab) => tab.scripts),
781+
...recommendTab.scripts,
782+
].flat();
783+
727784
function refreshSpecialTabs() {
728785
// add data to special tabs
729786
let recentTab = specialTabs.find((tab) => tab.id === CATEGORY.recently.id);
@@ -733,12 +790,12 @@ function refreshSpecialTabs() {
733790
if (favoriteTab) favoriteTab.scripts = favoriteScriptsSaver.get();
734791

735792
let allTab = specialTabs.find((tab) => tab.id === CATEGORY.all.id);
736-
if (allTab) allTab.scripts = sortScriptsByTab(Object.values(s), tabs);
793+
if (allTab) allTab.scripts = sortScriptsByTab(allScriptInTabs, tabs);
737794

738795
let autoTab = specialTabs.find((tab) => tab.id === CATEGORY.autorun.id);
739796
if (autoTab)
740797
autoTab.scripts = sortScriptsByTab(
741-
Object.values(s).filter((_) => canAutoRun(_)),
798+
allScriptInTabs.filter((_) => canAutoRun(_)),
742799
tabs
743800
);
744801
}

scripts/_ufs_statistic.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default {
1212
changeLogs: {
1313
1.66: {
1414
"2024-04-23": "init",
15+
"2024-04-27": "remove empty lines",
1516
},
1617
},
1718

@@ -27,7 +28,7 @@ export default {
2728
return;
2829
}
2930

30-
let logData = document.body.innerText.split("\n");
31+
let logData = document.body.innerText.split("\n").filter((_) => _);
3132

3233
// Function to extract time from log data
3334
function extractTime(log) {

scripts/content-scripts/ufs_global.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -609,10 +609,14 @@ UfsGlobal.Utils = {
609609
return null;
610610
}
611611
},
612+
svgToBlobUrl(svg) {
613+
let url = URL.createObjectURL(new Blob([svg], { type: "image/svg+xml" }));
614+
return url;
615+
},
612616
svgToBase64(svg) {
613617
try {
614618
return (
615-
"data:image/svg+xml;base64," +
619+
"data:image/svg+xml;charset=utf-8;base64," +
616620
window.btoa(new XMLSerializer().serializeToString(svg))
617621
);
618622
} catch (e) {

0 commit comments

Comments
 (0)