完善主题标题返回该吧和主楼图片显示问题

This commit is contained in:
xing 2023-07-09 13:17:04 +08:00
parent 5679b04222
commit 59dd292477

View File

@ -1,7 +1,7 @@
// ==UserScript== // ==UserScript==
// @name tieba page // @name tieba page
// @namespace http://tampermonkey.net/ // @namespace http://tampermonkey.net/
// @version 1.022 // @version 1.023
// @author fthvgb1 // @author fthvgb1
// @match https://tieba.baidu.com/* // @match https://tieba.baidu.com/*
// @match https://tiebac.baidu.com/* // @match https://tiebac.baidu.com/*
@ -26,6 +26,9 @@
if (imgs.length > 0) { if (imgs.length > 0) {
imgs.forEach(value => { imgs.forEach(value => {
let h = value.dataset.url.replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc'); let h = value.dataset.url.replace('tiebapic', 'imgsrc').replace('tiebapic', 'imgsrc');
if (h.indexOf('http://') === 0) {
h = 'https://image.baidu.com/search/down?url=' + h;
}
let tmp = decodeURIComponent(h.split('&src=')[1]).split('/'); let tmp = decodeURIComponent(h.split('&src=')[1]).split('/');
tmp = tmp[tmp.length - 1]; tmp = tmp[tmp.length - 1];
value.outerHTML = `<div class="pb_img_item" data-url="${h}"><img data-url="${tmp}" class="BDE_Image" src="${h}" alt=""></div>`; value.outerHTML = `<div class="pb_img_item" data-url="${h}"><img data-url="${tmp}" class="BDE_Image" src="${h}" alt=""></div>`;
@ -898,9 +901,16 @@
} }
function detail() { function detail() {
let title = document.querySelector('.post_title_text'); let title = document.querySelector('#i_head .post_title_text');
if (title) { if (title !== null) {
// title.href=title.href.replace('f?kw=','mo/q/m?word=') const ur = title.href.replace('f?kw=', 'mo/q/m?word=')
const u = new URL(ur);
u.searchParams.set('tn6', 'bdISP');
u.searchParams.set('tn4', 'bdKSW');
u.searchParams.set('tn7', 'bdPSB');
u.searchParams.set('sub4', '进吧');
u.searchParams.set('pn', '0');
title.href = u.toString()
} }
god(); god();
p(); p();