From 119f0b6274b79c1cd0af05aa694a0ce702e52047 Mon Sep 17 00:00:00 2001 From: xing Date: Sun, 29 Mar 2020 17:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9B=9E=E5=A4=8D=E4=B9=8B?= =?UTF-8?q?=E7=B1=BB=E7=9A=84=E4=BD=8D=E7=BD=AE=E5=8F=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/tieba page.js b/tieba page.js index 506dd56..5da38a4 100644 --- a/tieba page.js +++ b/tieba page.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tieba page // @namespace https://github.com/fthvgb1/tampermonkey-script -// @version 0.97 +// @version 0.98 // @author fthvgb1 // @match https://tieba.baidu.com/* // @match https://tiebac.baidu.com/* @@ -405,11 +405,29 @@ } + } + + function god() { + let targetNode = document.querySelector("#glob"); + let MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; + let observer = new MutationObserver((mutations) => { + let m = mutations[0]; + if (m.type === 'attributes' && m.attributeName === 'style' && m.target.style.display === 'none') { + m.target.style.display = 'block'; + } + }); + let observerOptions = { + attributes: true, + attributeFilter: ['style'] + }; + observer.observe(targetNode, observerOptions); + + } function detail() { - + god(); document.querySelector('a[class="ui_button ui_back j_span_back"]').addEventListener('click', event => { obs.src = obs.dataset.ss });