From 138e2f99c57a98fec7b1af02e7c993a58fa246c9 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Sun, 26 Jan 2025 06:29:57 +0800 Subject: [PATCH] feat: support `https://www.bilibili.com/v/popular/all` --- src/contentScripts/index.ts | 3 +++ src/contentScripts/views/App.vue | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/contentScripts/index.ts b/src/contentScripts/index.ts index e6c18d97..844f6653 100644 --- a/src/contentScripts/index.ts +++ b/src/contentScripts/index.ts @@ -37,6 +37,9 @@ function isSupportedPages(): boolean { // homepage isHomePage() + // popular page https://www.bilibili.com/v/popular/all + || /https?:\/\/(?:www\.)?bilibili\.com\/v\/popular\/all.*/.test(currentUrl) + // video page || /https?:\/\/(?:www\.)?bilibili\.com\/(?:video|list)\/.*/.test(currentUrl) // anime playback & movie page diff --git a/src/contentScripts/views/App.vue b/src/contentScripts/views/App.vue index 37775be7..642ed7a5 100644 --- a/src/contentScripts/views/App.vue +++ b/src/contentScripts/views/App.vue @@ -12,6 +12,7 @@ import { useSettingsStore } from '~/stores/settingsStore' import { isHomePage, isInIframe, isVideoOrBangumiPage, openLinkToNewTab, queryDomUntilFound, scrollToTop } from '~/utils/main' import emitter from '~/utils/mitt' +import { isSupportedIframePages } from '..' import { setupNecessarySettingsWatchers } from './necessarySettingsWatchers' const mainStore = useMainStore() @@ -125,7 +126,7 @@ watch( // Remove the original Bilibili top bar when using original bilibili page to avoid two top bars showing const biliHeader = document.querySelector('.bili-header') as HTMLElement | null - if (biliHeader) { + if (biliHeader && isSupportedIframePages()) { if (settingsStore.getDockItemIsUseOriginalBiliPage(activatedPage.value) && !isInIframe()) { biliHeader.style.visibility = 'hidden' }