mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Fix carousel images detection (fix #4586)
This commit is contained in:
parent
49a78b3747
commit
3be0e2c8cd
@ -21,14 +21,15 @@ export const setupFeedImageExporter: ComponentEntry<Options> = async ({
|
||||
text: '导出图片',
|
||||
action: async () => {
|
||||
const imageUrls: { url: string; extension: string }[] = []
|
||||
dqa(card.element, '.main-content .img-content, .bili-album__preview__picture__img').forEach(
|
||||
(img: HTMLImageElement | HTMLDivElement) => {
|
||||
const urlData = retrieveImageUrl(img)
|
||||
if (urlData && !imageUrls.some(({ url }) => url === urlData.url)) {
|
||||
imageUrls.push(urlData)
|
||||
}
|
||||
},
|
||||
)
|
||||
dqa(
|
||||
card.element,
|
||||
'.main-content .img-content, .bili-album__preview__picture__img, .bili-album .preview__picture__img',
|
||||
).forEach((img: HTMLImageElement | HTMLDivElement) => {
|
||||
const urlData = retrieveImageUrl(img)
|
||||
if (urlData && !imageUrls.some(({ url }) => url === urlData.url)) {
|
||||
imageUrls.push(urlData)
|
||||
}
|
||||
})
|
||||
if (imageUrls.length === 0) {
|
||||
Toast.info('此条动态没有检测到任何图片.', '导出图片')
|
||||
return
|
||||
|
||||
Loading…
Reference in New Issue
Block a user