去除百度贴吧的连续看图模式,改为点击新标签打开无水印原图,同时支持帖子预览中“查看大图”按钮。
当前为
// ==UserScript==
// @id tieba_simple_picview
// @name 百度贴吧科学看图君
// @version 2014.09.04
// @namespace jiayiming
// @author jiayiming
// @description 去除百度贴吧的连续看图模式,改为点击新标签打开无水印原图,同时支持帖子预览中“查看大图”按钮。
// @include http://tieba.baidu.com/p/*
// @include http://tieba.baidu.com/f?*
// @include http://tieba.baidu.com/i/*
// @homepageURL https://gf.qytechs.cn/scripts/784/
// @require http://code.jquery.com/jquery-2.1.1.min.js
// @grant unsafeWindow
// @run-at document-end
// @note 2014.09.04 FF32+GM2.2/Scriptish0.1.13pre.20140715测试通过
// ==/UserScript==
(function(){
//帖中图片去除click
unsafeWindow.$('.BDE_Image').unbind('click');
$(document).on('mousedown', '.BDE_Image', function(e){
// 兼容其它腳本
if (e.ctrlKey || e.altKey || e.shiftKey)
return ;
//$(this).unbind('click');
this.onclick = function(e){
if (e.button != 0)
return true;
var match = $(this).attr("src").match(/\/[a-z0-9]{20,}(?=\.[jpg|gif|png])/);
console.log('pic_id',match);
if (!match) {
return;
}
var picSrc = "http://imgsrc.baidu.com/forum/pic/item" + match[0] + ".jpg";
window.open(picSrc);
e.preventDefault();
return false;
};
});
// 帖子列表预览中图片,还原“查看大图”按钮链接
$(document).on('mousedown', '.tb_icon_ypic', function(){
var d = this.href;
if (d.indexOf('pic_id') > 0) {
var start = d.indexOf('pic_id') + 7;
var end = d.indexOf('&', start);
var pic = 'http://imgsrc.baidu.com/forum/pic/item/' + d.substring(start, end) + '.jpg'
this.href = pic;
}
});
// i贴吧帖子预览中图片,还原“查看大图”按钮链接
$(document).on('mousedown', '.j_full', function(){
var d = this.href;
if (d.indexOf('pic_id') > 0) {
var start = d.indexOf('pic_id') + 7;
var end = d.indexOf('&', start);
var pic = 'http://imgsrc.baidu.com/forum/pic/item/' + d.substring(start, end) + '.jpg'
this.href = pic;
}
});
})();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址