Greasy Fork is available in English.

百度贴吧科学看图君

去除百度贴吧的连续看图模式,改为点击新标签打开无水印原图,同时支持帖子预览中“查看大图”按钮。

ของเมื่อวันที่ 07-09-2014 ดู เวอร์ชันล่าสุด

// ==UserScript==
// @id			tieba_simple_picview
// @name		百度贴吧科学看图君
// @version		2014.09.07
// @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://greasyfork.org/scripts/784/
// @require		http://code.jquery.com/jquery-2.1.1.min.js
// @grant			unsafeWindow
// @run-at		document-end
// @note			2014.09.07	翻页失效修复
// @note			2014.09.04	FF32+GM2.2/Scriptish0.1.13pre.20140715测试通过
// ==/UserScript==

(function(){

	$(document).on('mousedown', '.BDE_Image', function(e){
		//帖中图片去除click
		unsafeWindow.$('.BDE_Image').unbind('click');
		//$(this).unbind('click');
		
		// 兼容其它腳本
		if (e.ctrlKey || e.altKey || e.shiftKey)
			return ;

		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;
		}
	});
})();