Merge branch 'dev' into refactor/lazy-components

This commit is contained in:
star knight
2024-01-15 13:48:05 +08:00
committed by GitHub
21 changed files with 3047 additions and 2343 deletions

View File

@@ -32,6 +32,8 @@ function isSupportedPages() {
|| /https?:\/\/www.bilibili.com\/index.html$/.test(currentUrl)
|| /https?:\/\/bilibili.com\/\?spm_id_from=.*/.test(currentUrl)
|| /https?:\/\/www.bilibili.com\/\?spm_id_from=(.)*/.test(currentUrl)
// fix #166 https://github.com/hakadao/BewlyBewly/issues/166
|| /https?:\/\/www.bilibili.com\/\?bvid=.*$/.test(currentUrl)
// video page
|| /https?:\/\/(www.)?bilibili.com\/video\/.*/.test(currentUrl)
@@ -57,8 +59,11 @@ function isSupportedPages() {
|| /https?:\/\/www.bilibili.com\/v\/.*/.test(currentUrl)
// anime page & chinese anime page
|| /https?:\/\/www.bilibili.com\/(anime|guochuang).*/.test(currentUrl)
// tv shows, movie, variety shows, mooc page
|| /https?:\/\/(www.)?bilibili.com\/(tv|movie|variety|mooc).*/.test(currentUrl))
// channel page e.g. tv shows, movie, variety shows, mooc page
|| /https?:\/\/(www.)?bilibili.com\/(tv|movie|variety|mooc|documentary).*/.test(currentUrl)
// article page
|| /https?:\/\/(www.)?bilibili.com\/(read).*/.test(currentUrl)
)
return true
else
return false

View File

@@ -52,8 +52,10 @@ const isTopBarFixed = computed(() => {
|| /https?:\/\/(www.)?bilibili.com\/bangumi\/play\/.*/.test(location.href)
// moment page
|| /https?:\/\/t.bilibili.com.*/.test(location.href)
// channel, anime, chinese anime, tv shows, movie, variety shows, mooc page
// channel, anime, chinese anime, tv shows, movie, variety shows, mooc
|| /https?:\/\/(www.)?bilibili.com\/(v|anime|guochuang|tv|movie|variety|mooc).*/.test(location.href)
// articles page
|| /https?:\/\/(www.)?bilibili.com\/read\/home.*/.test(location.href)
)
return true
return false
@@ -93,6 +95,8 @@ watch(() => settings.value.adaptToOtherPageStyles, () => {
})
onMounted(() => {
openVideoPageIfBvidExists()
if (isHomePage()) {
// Force overwrite Bilibili Evolved body tag & html tag background color
document.body.style.setProperty('background-color', 'unset', 'important')
@@ -241,6 +245,19 @@ provide<BewlyAppProvider>('BEWLY_APP', {
handlePageRefresh,
handleReachBottom,
})
// fix #166 https://github.com/hakadao/BewlyBewly/issues/166
function openVideoPageIfBvidExists() {
// Assume the URL is https://www.bilibili.com/?bvid=BV1be41127ft&spm_id_from=333.788.seo.out
// Get the current URL's query string
const queryString = window.location.search
// Create a URLSearchParams instance
const urlParams = new URLSearchParams(queryString)
const bvid = urlParams.get('bvid')
if (bvid)
window.open(`https://www.bilibili.com/video/${bvid}`, '_self')
}
</script>
<template>

View File

@@ -136,7 +136,7 @@ onUnmounted(() => {
</Transition>
<header
pos="sticky top-80px" w-fit z-10 mb-9 duration-300
pos="sticky top-80px" w-fit z-9 mb-9 duration-300
ease-in-out
:class="{ hide: shouldMoveTabsUp }"
>