feat: support dark mode for watch later, 404 page && adjust the regex rules

This commit is contained in:
hakadao
2024-03-31 04:31:31 +08:00
parent 43878d691b
commit 96a85047da
5 changed files with 159 additions and 40 deletions

View File

@@ -30,36 +30,40 @@ function isSupportedPages() {
// homepage
isHomePage()
// fix #166 https://github.com/hakadao/BewlyBewly/issues/166
|| /https?:\/\/www.bilibili.com\/\?bvid=.*$/.test(currentUrl)
|| /https?:\/\/www\.bilibili\.com\/\?bvid=.*$/.test(currentUrl)
// video page
|| /https?:\/\/(www.)?bilibili.com\/(video|list)\/.*/.test(currentUrl)
|| /https?:\/\/(www.)?bilibili\.com\/(video|list)\/.*/.test(currentUrl)
// anime playback & movie page
|| /https?:\/\/(www.)?bilibili.com\/bangumi\/play\/.*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/bangumi\/play\/.*/.test(currentUrl)
// watch later playlist
|| /https?:\/\/(www.)?bilibili.com\/list\/watchlater.*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/list\/watchlater.*/.test(currentUrl)
// favorite playlist
|| /https?:\/\/(www.)?bilibili.com\/list\/ml.*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/list\/ml.*/.test(currentUrl)
// search page
|| /https?:\/\/search.bilibili.com\.*/.test(currentUrl)
|| /https?:\/\/search\.bilibili\.com\.*/.test(currentUrl)
// moments
|| /https?:\/\/t.bilibili.com\.*/.test(currentUrl)
|| /https?:\/\/t\.bilibili\.com\.*/.test(currentUrl)
// moment detail
|| /https?:\/\/www.bilibili.com\/opus\/.*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/opus\/.*/.test(currentUrl)
// history page
|| /https?:\/\/(www.)?bilibili.com\/account\/history.*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/account\/history.*/.test(currentUrl)
// watcher later page
|| /https?:\/\/(www\.)?bilibili\.com\/watchlater\/#\/list.*/.test(currentUrl)
// user space page
|| /https?:\/\/space.bilibili.com\.*/.test(currentUrl)
|| /https?:\/\/space\.bilibili\.com\.*/.test(currentUrl)
// notifications page
|| /https?:\/\/message.bilibili.com\.*/.test(currentUrl)
|| /https?:\/\/message\.bilibili\.com\.*/.test(currentUrl)
// bilibili channel page b站分区页面
|| /https?:\/\/www.bilibili.com\/v\/(?!popular).*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/v\/(?!popular).*/.test(currentUrl)
// anime page & chinese anime page
|| /https?:\/\/www.bilibili.com\/(anime|guochuang).*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/(anime|guochuang).*/.test(currentUrl)
// channel page e.g. tv shows, movie, variety shows, mooc page
|| /https?:\/\/(www.)?bilibili.com\/(tv|movie|variety|mooc|documentary).*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/(tv|movie|variety|mooc|documentary).*/.test(currentUrl)
// article page
|| /https?:\/\/(www.)?bilibili.com\/(read).*/.test(currentUrl)
|| /https?:\/\/(www\.)?bilibili\.com\/(read).*/.test(currentUrl)
// 404 page
|| /^https?:\/\/(www\.)?bilibili\.com\/404.*$/.test(currentUrl)
)
return true
else