From e2b3d6dd96e1ec534d60c83b19650de00916e4e9 Mon Sep 17 00:00:00 2001 From: MidnightCrowing <110297461+MidnightCrowing@users.noreply.github.com> Date: Sat, 2 Nov 2024 12:40:16 +0800 Subject: [PATCH] fix(watch-later): prevent outer link navigation when clicking on video card title or author (#1103) --- .../views/WatchLater/WatchLater.vue | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/contentScripts/views/WatchLater/WatchLater.vue b/src/contentScripts/views/WatchLater/WatchLater.vue index ae5770af..5ea4620a 100644 --- a/src/contentScripts/views/WatchLater/WatchLater.vue +++ b/src/contentScripts/views/WatchLater/WatchLater.vue @@ -136,6 +136,18 @@ function handlePlayAll() { openLinkToNewTab('https://www.bilibili.com/list/watchlater') } +function handleLinkClick(url: string) { + if (settings.value.videoCardLinkOpenMode === 'drawer') { + openIframeDrawer(url) // 在抽屉打开 + } + else if (settings.value.videoCardLinkOpenMode === 'currentTab') { + window.open(url, '_self') // 在当前标签页打开 + } + else { + openLinkToNewTab(url) // 在新标签页打开 + } +} + function jumpToLoginPage() { location.href = 'https://passport.bilibili.com/login' } @@ -154,11 +166,10 @@ function jumpToLoginPage() {
{{ item.title }} @@ -249,6 +260,7 @@ function jumpToLoginPage() { duration-300 pr-2 :href="`//space.bilibili.com/${item.owner.mid}`" target="_blank" + @click.stop >