From 55ff625f302945643b2b437e75db1ec49e657442 Mon Sep 17 00:00:00 2001 From: xing Date: Wed, 25 Mar 2020 16:43:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A5=BC=E4=B8=AD=E6=A5=BC=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/tieba page.js b/tieba page.js index f02580c..5422c57 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.92 +// @version 0.93 // @author fthvgb1 // @match https://tieba.baidu.com/* // @match http://tieba.baidu.com/* @@ -145,7 +145,7 @@ let text = floor[0].textContent; let url = `https://tieba.baidu.com/t/p/${tid}`; let num = parseInt(text.match(/\d+/)); - content.append(`
还有` + num + `条回复
`); + content.append(`
还有${num}条回复
`); let res = content.find('a.reply'); let orgnum = num; //console.log(content,res); @@ -165,8 +165,9 @@ if (index < 2) { return; } - let username = li.querySelector('.left>div .user_name').outerHTML; - username = username.replace('', ':'); + let uuu = li.querySelector('.left>div .user_name'); + let username = uuu.outerHTML; + username = username.replace('', ':').replace('javascript:;', `/home/main?un=${uuu.innerText.replace(/ /g, '')}`); let s = li.querySelector('.content span'); s.className = 'floor_content'; let c = li.querySelector('.content').innerHTML; @@ -182,6 +183,7 @@ ll.classList.add('list_item_floor'); ll.classList.add('j_list_item_floor'); ll.innerHTML = div; + ll.setAttribute('data-info', li.dataset.info); //console.log(content.find('.flist')) content.find('.flist')[0].appendChild(ll) @@ -199,8 +201,10 @@ let ht = (new DOMParser()).parseFromString(res.data.floor_html, 'text/html'); let lii = ht.querySelectorAll('li'); lii.forEach(function (li, index) { - let username = li.querySelector('.left>div .user_name').outerHTML; - username = username.replace('', ':'); + + let uuu = li.querySelector('.left>div .user_name'); + let username = uuu.outerHTML; + username = username.replace('', ':').replace('javascript:;', `/home/main?un=${uuu.innerText.replace(/ /g, '')}`); let s = li.querySelector('.content span'); s.className = 'floor_content'; let c = li.querySelector('.content').innerHTML; @@ -216,6 +220,7 @@ ll.classList.add('list_item_floor'); ll.classList.add('j_list_item_floor'); ll.innerHTML = div; + ll.setAttribute('data-info', li.dataset.info); //console.log(content.find('.flist')) content.find('.flist')[0].appendChild(ll) @@ -568,6 +573,8 @@ .footer-title { display:none !important;} .footer-version-client-logo { display:none !important;} .client-btn { display:none !important;} + .footer_logo { display:none !important;} + .footer-version { display:none !important;} `; document.querySelector('head').append(css);