fix: prevent top bar from displaying on unexpected pages (#1266)

close #1266
This commit is contained in:
Hakadao
2025-01-12 15:24:48 +08:00
parent 7b293b7d88
commit 5363cf4a2d

View File

@@ -47,12 +47,11 @@ function isSupportedPages(): boolean {
|| /https?:\/\/(?:www\.)?bilibili\.com\/list\/ml.*/.test(currentUrl)
// search page
|| /https?:\/\/search\.bilibili\.com\.*/.test(currentUrl)
// moments
|| (
/https?:\/\/t\.bilibili\.com\.*/.test(currentUrl)
// https://github.com/BewlyBewly/BewlyBewly/issues/1256
&& !/https?:\/\/t\.bilibili\.com\/vote.*/.test(currentUrl)
)
// moments page
// https://github.com/BewlyBewly/BewlyBewly/issues/1246
// https://github.com/BewlyBewly/BewlyBewly/issues/1256
// https://github.com/BewlyBewly/BewlyBewly/issues/1266
|| /https?:\/\/t\.bilibili\.com(?!\/vote|\/share).*/.test(currentUrl)
// moment detail
|| /https?:\/\/(?:www\.)?bilibili\.com\/opus\/.*/.test(currentUrl)
// history page
@@ -100,14 +99,11 @@ export function isSupportedIframePages(): boolean {
|| /https?:\/\/space\.bilibili\.com\/\d+\/favlist.*/.test(currentUrl)
|| /https?:\/\/www\.bilibili\.com\/history.*/.test(currentUrl)
|| /https?:\/\/www\.bilibili\.com\/watchlater\/#\/list.*/.test(currentUrl)
|| (
/https?:\/\/t\.bilibili\.com.*/.test(currentUrl)
// https://github.com/BewlyBewly/BewlyBewly/issues/1246
&& !/https?:\/\/t\.bilibili\.com\/share\/card\/index.*/.test(currentUrl)
// https://github.com/BewlyBewly/BewlyBewly/issues/1256
&& !/https?:\/\/t\.bilibili\.com\/h5\/dynamic\/vote.*/.test(currentUrl)
)
// moments page
// https://github.com/BewlyBewly/BewlyBewly/issues/1246
// https://github.com/BewlyBewly/BewlyBewly/issues/1256
// https://github.com/BewlyBewly/BewlyBewly/issues/1266
|| /https?:\/\/t\.bilibili\.com(?!\/vote|\/share).*/.test(currentUrl)
// Since `Open in drawer` will open the video page within an iframe, so we need to support the following pages
// video page
|| /https?:\/\/(?:www\.)?bilibili\.com\/(?:video|list)\/.*/.test(currentUrl)