Skip to content

Commit 9e4c5f2

Browse files
committed
update
1 parent 4b4e31a commit 9e4c5f2

File tree

3 files changed

+158
-391
lines changed

3 files changed

+158
-391
lines changed

scripts/content-scripts/ufs_global.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,17 +770,23 @@ async function downloadToFolder({
770770
url,
771771
fileName,
772772
dirHandler,
773-
expectBlobType,
773+
expectBlobTypes,
774774
subFolderName = "",
775775
}) {
776776
if (!url) return false;
777777
try {
778778
// const f = getOriginalWindowFunction("fetch");
779779
const res = await fetch(url);
780780
const blob = await res.blob();
781-
if (expectBlobType && blob.type !== expectBlobType) {
781+
// blobtype canbe regex
782+
if (
783+
expectBlobTypes?.length &&
784+
!expectBlobTypes.find((t) =>
785+
t?.test ? t.test(blob.type) : t === blob.type
786+
)
787+
) {
782788
throw new Error(
783-
`Blob type ${blob.type} doesn't match expected type ${expectBlobType}`
789+
`Blob type ${blob.type} doesn't match expected type ${expectBlobTypes}`
784790
);
785791
}
786792
const fileHandler = await dirHandler.getFileHandle(fileName, {

scripts/tiktok_batchDownload.css

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
}
3737

3838
.ufs_popup {
39+
position: relative;
3940
background: #444;
4041
color: #eee;
4142
padding: 20px;
@@ -110,3 +111,44 @@
110111
.ufs_popup .clickable:hover {
111112
background: #666;
112113
}
114+
115+
.ufs_popup .ufs-scroll-to-top {
116+
position: absolute;
117+
bottom: 10px;
118+
right: 10px;
119+
border-radius: 10px;
120+
cursor: pointer;
121+
background: #444;
122+
color: white;
123+
padding: 10px;
124+
}
125+
126+
/* check boxes */
127+
.ufs_is_private {
128+
position: absolute;
129+
top: 0;
130+
right: 0;
131+
color: red;
132+
background: black;
133+
padding: 8px;
134+
font-weight: bold;
135+
}
136+
137+
.ufs_tiktok_checkbox {
138+
z-index: 2;
139+
position: absolute;
140+
top: 0;
141+
right: 0;
142+
width: 50px;
143+
height: 50px;
144+
transition: all 0.1s ease;
145+
}
146+
147+
.ufs_tiktok_checkbox:hover {
148+
transform: scale(1.3);
149+
}
150+
151+
.ufs-video-checkbox {
152+
width: 30px;
153+
height: 30px;
154+
}

0 commit comments

Comments
 (0)