// ==UserScript==
// @name 096.cc
// @namespace 096.cc
// @description 096.cc image filter
// @include http://www.096.cc/*
// ==/UserScript==
(function(){
var href = window.location.href;
if(href.indexOf("ShowForum.asp")!=-1)
hideForum();
else if(href.indexOf("ShowPost.asp")!=-1)
hideThread();
else if(href.indexOf("Default.asp")!=-1 || href=="http://www.096.cc/" )
hideMain();
HideCommon();
function HideCommon(){
var xpath;
xpath="/html/body/table[2]";
remove(xpath);
xpath="/html/body/table[1]";
remove(xpath);
xpath="//table[@bgcolor='#333333']";
remove(xpath);
}
function hideMain(){
var xpath;
xpath="/html/body/table[10]";
remove(xpath);
xpath="/html/body/table[5]";
remove(xpath);
}
function hideForum(){
var xpath;
xpath="/html/body/table[9]";
remove(xpath);
}
function hideThread(){
var xpath="//img";
var el;
var els = document.evaluate(xpath, document, null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < els.snapshotLength; i++) {
el = els.snapshotItem(i);
if(el.src.indexOf("UpFile/UpAttachment")!=-1 || el.src.indexOf("images/upface")!=-1 || el.src.indexOf("images/face")!=-1 || el.src.indexOf("UpFile/UpFace")!=-1)
el.parentNode.removeChild(el);
}
}
function remove(xpath){
var el;
var els = document.evaluate(xpath, document, null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < els.snapshotLength; i++) {
el = els.snapshotItem(i);
el.parentNode.removeChild(el);
}
}
}) ();
没有评论:
发表评论