From b55952278d4f2b5239a96bc1e16d8b418cf67821 Mon Sep 17 00:00:00 2001 From: Hakadao Date: Mon, 9 Dec 2024 23:06:53 +0800 Subject: [PATCH] fix: prevent `` from showing outside the bilibili homepage --- src/contentScripts/views/App.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/contentScripts/views/App.vue b/src/contentScripts/views/App.vue index 84f94cce..48b0aae0 100644 --- a/src/contentScripts/views/App.vue +++ b/src/contentScripts/views/App.vue @@ -63,6 +63,14 @@ const showBewlyPage = computed((): boolean => { } }) +const showIframePage = computed((): boolean => { + // If the iframe is not the BiliBili homepage, then don't show the iframe page + if (!isHomePage(window.self.location.href)) + return false + // use `!isInIframe()` to prevent nested calls to the BiliBili homepage + return !isInIframe() && !!iframePageURL.value && !!activatedPage.value +}) + const isFirstTimeActivatedPageChange = ref(true) watch( () => activatedPage.value, @@ -276,7 +284,7 @@ provide('BEWLY_APP', { pointer-events-none > ('BEWLY_APP', { - - +