feat: block top search page ads (#1207)

close #1207
This commit is contained in:
Hakadao
2024-12-24 00:58:27 +08:00
parent 7fb5f26134
commit d41ad75e33
8 changed files with 35 additions and 2 deletions

View File

@@ -177,6 +177,21 @@ export function setupNecessarySettingsWatchers() {
document.documentElement.classList.remove('block-useless-contents')
}, { immediate: true })
/**
* 搜尋結果的上方的廣告,但有時是年末總結、年度報告這些
*/
const blockTopSearchPageAdsStyleEl = injectCSS(`
.activity-game-list {
display: none !important;
}
`)
watch(() => settings.value.blockTopSearchPageAds, () => {
if (settings.value.blockTopSearchPageAds)
document.documentElement.appendChild(blockTopSearchPageAdsStyleEl)
else
document.documentElement.removeChild(blockTopSearchPageAdsStyleEl)
}, { immediate: true })
watch(
() => settings.value.themeColor,
() => {