Saturday, November 26, 2011

Just played around with Greasemonkey

I'm not a javascript expert, but just played around using js in greasemonkey, quite funny.

// ==UserScript==
// @name FilterGuruEntry
// @description Filter Guru Entry
// @include http://www.guru.com/pro/search_results.cfm*
// ==/UserScript==


var allTRs, thisTR;
allTRs = document.getElementsByTagName('SPAN');
for (var i = 0; i < allTRs.length; i++) {

thisTR = allTRs[i];

if (thisTR.getAttribute("class") == "btblue") {

//myTBODY = thisTR.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
myTR = thisTR.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
myTD = thisTR.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;

if (myTR.nodeName == "TR") {
//myTR.removeChild(myTD);
//myTR.removeChild(myTR.lastChild);
myTR.removeChild(myTD);

}

//myTBODY.removeChild(myTR);
}
}

No comments:

Post a Comment

CSP on Apache

To add CSP to root if sort of funny. The following will NOT work for most cases !!     <LocationMatch "^/$">        Header s...