mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Ignore forEachFeedsCard on non-feeds page
This commit is contained in:
parent
60b427fdea
commit
c2092dc567
@ -1,4 +1,5 @@
|
|||||||
import { getCookieValue, matchUrlPattern } from '@/core/utils'
|
import { getCookieValue, matchUrlPattern } from '@/core/utils'
|
||||||
|
import { feedsUrls } from '@/core/utils/urls'
|
||||||
import { FeedsCardCallback } from '../types'
|
import { FeedsCardCallback } from '../types'
|
||||||
import { feedsCardCallbacks } from './base'
|
import { feedsCardCallbacks } from './base'
|
||||||
import { FeedsCardsManagerV1 } from './v1'
|
import { FeedsCardsManagerV1 } from './v1'
|
||||||
@ -28,6 +29,10 @@ export const feedsCardsManager = (() => {
|
|||||||
* @param callback 回调函数
|
* @param callback 回调函数
|
||||||
*/
|
*/
|
||||||
export const forEachFeedsCard = async (callback: FeedsCardCallback) => {
|
export const forEachFeedsCard = async (callback: FeedsCardCallback) => {
|
||||||
|
if (feedsUrls.every(url => !matchUrlPattern(url))) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
const success = await feedsCardsManager.startWatching()
|
const success = await feedsCardsManager.startWatching()
|
||||||
if (!success) {
|
if (!success) {
|
||||||
console.error('feedsCardsManager.startWatching() failed')
|
console.error('feedsCardsManager.startWatching() failed')
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user