getElementsByClassName
function getElementsByClassName(className) {
var el = new Array();
var _el = document.getElementsByTagName("*");
for (var i=0; i<_el.length; i++ ) {
if (_el[i].className == className) {
el[el.length] = _el[i];
}
}
return el;
}
function removejscssfile(filename, filetype){
var targetelement=(filetype=="js")? "script" : (filetype=="css")? "link" : "none";
var targetattr=(filetype=="js")? "src" : (filetype=="css")? "href" : "none";
var allsuspects=document.getElementsByTagName(targetelement);
for (var i=allsuspects.length; i>=0; i--){
if (allsuspects[i] && allsuspects[i].getAttribute(targetattr)!=null && allsuspects[i].getAttribute(targetattr).indexOf(filename)!=-1)
allsuspects[i].parentNode.removeChild(allsuspects[i]);
}
}
document.getElementById("csdn-toolbar").remove();
document.getElementById("dmp_ad_58").remove();
getElementsByClassName("blog_container_aside")[0].remove();
getElementsByClassName("recommend-right align-items-stretch clearfix")[0].remove();
getElementsByClassName("csdn-side-toolbar")[0].remove();
getElementsByClassName("recommend-box")[0].remove();
getElementsByClassName("pay-code")[0].remove();
getElementsByClassName("comment-box")[0].remove();
getElementsByClassName("more-toolbox")[0].remove();
getElementsByClassName("report-box")[0].remove();
getElementsByClassName("person-messagebox")[0].remove();
getElementsByClassName("template-box")[0].remove();
getElementsByClassName("article-bar-top")[0].remove();
removejscssfile("detail_enter-cc3d49b276.min.css", "css");