From 3e8cdb5573f185a97a0ebba19ee0855497127d21 Mon Sep 17 00:00:00 2001 From: xiu2 <54703944+XIU2@users.noreply.github.com> Date: Fri, 8 Oct 2021 16:14:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20[=E6=96=B0=E6=A0=87?= =?UTF-8?q?=E7=AD=BE=E9=A1=B5=E6=89=93=E5=BC=80=E9=93=BE=E6=8E=A5]=20?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=88=E9=80=82=E9=85=8D=E5=85=A8=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- V2ex-Enhanced.user.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/V2ex-Enhanced.user.js b/V2ex-Enhanced.user.js index a43d38f..0a55a29 100644 --- a/V2ex-Enhanced.user.js +++ b/V2ex-Enhanced.user.js @@ -326,12 +326,12 @@ for (const target of mutation.addedNodes) { if (target.nodeType != 1) return if (target.tagName === 'A') { - if (target.href.slice(0,4) != 'http' || target.href.indexOf('#;') > -1 || target.onclick) { + if (target.onclick || target.href.slice(0,4) != 'http' || target.href.indexOf('#;') > -1 || target.href.indexOf('night/toggle') > -1 || target.href.indexOf('/favorite') > -1) { target.target = '_self' } } else { document.querySelectorAll('a').forEach(function (_this) { - if (_this.href.slice(0,4) != 'http' || _this.href.indexOf('#;') > -1 || _this.onclick) { + if (_this.onclick || _this.href.slice(0,4) != 'http' || _this.href.indexOf('#;') > -1 || _this.href.indexOf('night/toggle') > -1 || _this.href.indexOf('/favorite') > -1) { _this.target = '_self' } });