您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Some tweaks on the Hung-Ya forum
当前为
// ==UserScript== // @name Hung-Ya Tweaks // @description Some tweaks on the Hung-Ya forum // @include http://bbs.bbs-tw.com/* // @version 0.0.1.20140527085308 // @namespace https://greasyfork.org/users/2233 // ==/UserScript== var wnd = window; var doc = wnd.document; var loc = location; var href = loc.href; if(/^http:\/\/bbs\.bbs-tw\.com\/.*\/postshow\.pl\b/.test(href)) { // Auto redirection upon failure if( (!doc.getElementById("BbsShowMenu")) || (!/&_=/.test(href)) ) { loc.href += "&_=" + +(new Date); throw 'exit'; } // Remove scripts var scripts=doc.getElementsByTagName('script'); for(var i=scripts.length-1; i>=0; i--){ try { scripts[i].parentNode.removeChild(scripts[i]); } catch(err){ alert(err); } } // Diable the <meta> refresh addEventListener("DOMContentLoaded", function(){ wnd.stop(); if(!doc.getElementById("BbsShowMenu")) { loc.reload(); }; }, false); // Clear all timeouts/intervals setTimeout(function() { var id = setTimeout(function() {}, 0); while(id--) { clearTimeout(id); } var id = setInterval(function() {}, 0); while(id--) { clearInterval(id); } }, 100) // Reload broken images addEventListener("DOMContentLoaded", function(){ var is_img_ok = function(img) { if(img.readyState!='complete'){ return false; } if(('naturalHeight' in img)&&(img.naturalHeight+img.naturalWidth==0)){ return false; } if(img.width+img.height==0){ return false; } return true; }; var reloadImages=function(w) { try { for(var i=0; img=w.document.images[i]; i++){ if(!is_img_ok(img)){ img.src=img.src; } } // doc.images[j]... does not work, cuz doc isn't a member of a window object for(var j=0,F=null;F=w.frames[j];j++){ reloadImages(F); } } catch(e){ } }; reloadImages(wnd); }, false); throw 'exit'; }