Monday, May 7, 2007

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") {
      myTR = thisTR.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;

myTD = thisTR.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;

if (myTR.nodeName == "TR") {

myTR.removeChild(myTD);

}

}

}

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...