mirror of
https://github.com/BewlyBewly/BewlyBewly.git
synced 2025-04-14 13:15:29 +00:00
feat: block ads
This commit is contained in:
@@ -94,6 +94,16 @@ watch(() => settings.value.adaptToOtherPageStyles, () => {
|
||||
handleAdaptToOtherPageStylesChange()
|
||||
})
|
||||
|
||||
watch(() => settings.value.blockAds, () => {
|
||||
handleBlockAds()
|
||||
})
|
||||
|
||||
onBeforeMount(() => {
|
||||
handleBlockAds()
|
||||
setAppThemeColor()
|
||||
handleAdaptToOtherPageStylesChange()
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
// openVideoPageIfBvidExists()
|
||||
|
||||
@@ -114,8 +124,6 @@ onMounted(() => {
|
||||
handleChangeAccessKey()
|
||||
setAppAppearance()
|
||||
setAppLanguage()
|
||||
setAppThemeColor()
|
||||
handleAdaptToOtherPageStylesChange()
|
||||
})
|
||||
|
||||
function handleChangeAccessKey() {
|
||||
@@ -237,6 +245,13 @@ function handleOsScroll() {
|
||||
topBarRef.value?.handleScroll()
|
||||
}
|
||||
|
||||
function handleBlockAds() {
|
||||
if (settings.value.blockAds)
|
||||
document.documentElement.classList.add('block-ads')
|
||||
else
|
||||
document.documentElement.classList.remove('block-ads')
|
||||
}
|
||||
|
||||
// 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
|
||||
|
||||
Reference in New Issue
Block a user