From 6be202bbc732d5eb61eea8b74a05062e04a51f78 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Tue, 15 Nov 2022 19:54:11 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E6=9B=B4=E6=96=B0=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/twitter.css | 11 +++++++++++ src-tauri/src/pake.js | 5 +++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dist/twitter.css b/dist/twitter.css index bf4e6ef..5677b6d 100644 --- a/dist/twitter.css +++ b/dist/twitter.css @@ -93,7 +93,18 @@ a[href='/i/bookmarks'] { header[role='banner'] nav[role='navigation']:hover > * > div { backdrop-filter: blur(12px) !important; } + header[role='banner'] nav[role='navigation'] > a { + position: relative; + } + header[role='banner'] nav[role='navigation'] > a::before { + content: ''; + position: absolute; + top: 0px; + right: -40px; + bottom: 0px; + left: 0px; + } /* Align account button with floating tweet button */ [data-testid='SideNav_AccountSwitcher_Button'] { bottom: 18px !important; diff --git a/src-tauri/src/pake.js b/src-tauri/src/pake.js index b2610df..5c0adcc 100644 --- a/src-tauri/src/pake.js +++ b/src-tauri/src/pake.js @@ -128,10 +128,11 @@ window.addEventListener('DOMContentLoaded', (_event) => { document.addEventListener('click', (e) => { const origin = e.target.closest('a'); - const href = origin.href; - if (href) { + if (origin && origin.href) { origin.target = '_self'; + //额外处理下 twitter 的外跳,对于其他需要外跳的可以改这里成对应域名 + const href = origin.href; if(location.host === "twitter.com" && href.indexOf("twitter.com")===-1){ e.preventDefault(); window.ipc.postMessage(`open_browser:${href}`);