Bilibili-Evolved/registry/lib/components/feeds/unfold/index.ts
2021-10-26 13:19:37 +08:00

22 lines
628 B
TypeScript

import { ComponentMetadata } from '@/components/types'
import { feedsUrlsWithoutDetail } from '@/core/utils/urls'
export const component: ComponentMetadata = {
name: 'unfoldFeeds',
displayName: '动态反折叠',
tags: [componentsTags.feeds],
description: {
'zh-CN': '自动展开被折叠的动态.',
},
urlInclude: feedsUrlsWithoutDetail,
entry: async () => {
const { forEachFeedsCard } = await import('@/components/feeds/api')
forEachFeedsCard({
added: card => {
const foldButton = dq(card.element, '.fold-hoverable') as HTMLElement
foldButton?.click()
},
})
},
}