From 15b7e301c13b957152a30be96e1e5fd96afcbf52 Mon Sep 17 00:00:00 2001 From: fthvgb1 Date: Fri, 28 Feb 2020 11:58:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=89=93=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tieba page.js b/tieba page.js index a7f3dc4..8c473bf 100644 --- a/tieba page.js +++ b/tieba page.js @@ -1,10 +1,11 @@ // ==UserScript== // @name tieba page // @namespace http://tampermonkey.net/ -// @version 0.61 +// @version 0.70 // @author fthvgb1 // @match https://tieba.baidu.com/* -// @grant none +// @grant GM.openInTab + // @description 显示手机版贴吧里被隐藏的楼层与翻页按钮 // ==/UserScript== @@ -250,12 +251,14 @@ a.classList.remove('tl_shadow_for_app'); }) } - //debugger let lis = document.querySelectorAll('li.tl_shadow>a[data-thread-type="0"]'); if (lis.length > 0) { lis.forEach(value => { - //debugger - value.setAttribute('target', '_blank') + let url = value.href; + value.href = 'javascript:void(0);'; + value.onclick = (v) => { + GM.openInTab(url, true); + } }) }