From d3f2c7c7c7ed9a931ac8bcccffe015604d4ce011 Mon Sep 17 00:00:00 2001 From: xing Date: Mon, 29 May 2023 20:13:43 +0800 Subject: [PATCH] =?UTF-8?q?fix=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tieba page.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/tieba page.js b/tieba page.js index 6864a11..ae61921 100644 --- a/tieba page.js +++ b/tieba page.js @@ -1,7 +1,7 @@ // ==UserScript== // @name tieba page // @namespace http://tampermonkey.net/ -// @version 1.020 +// @version 1.021 // @author fthvgb1 // @match https://tieba.baidu.com/* // @match https://tiebac.baidu.com/* @@ -902,6 +902,7 @@ if (title) { // title.href=title.href.replace('f?kw=','mo/q/m?word=') } + fixHeadImages(); god(); p(); reply(); @@ -937,6 +938,22 @@ } + function fixHeadImages() { + const e = document.querySelectorAll("#pblist li .list_item_top_avatar img"); + e.forEach(img => { + let src = img.src; + //http://gss3.bdstatic.com/84oSdTum2Q5BphGlnYG/timg?mowebapp&quality=80&size=b72_72&cut_x=0&cut_w=0&cut_y=0&cut_h=0&sec=1369815402&di=d90486ddc230fa80b609654f1ef9491b&wh_rate=null&src=http%3A%2F%2Ftb.himg.baidu.com%2Fsys%2Fportrait%2Fitem%2Ftb.1.a55b4bff.yLhcG9k0TG9vPBPgt_D19A.jpg + if (src.indexOf('http://') === 0) { + const u = new URL(src) + if (u.searchParams.has('src')) { + src = decodeURIComponent(u.searchParams.get('src')); + src = 'https://image.baidu.com/search/down?url=' + src; + } + img.src = src; + } + }) + } + let book, svgss; function clickControl() {