// ==UserScript== // @name GCHiddenText Redux // @namespace http://userscripts.org/users/201960 // @description Display "hidden text" or "HTML Comments". // @include *.geocaching.com/geocache/* // @version 3.0.0 // @downloadURL none // ==/UserScript== /*----------------------History--------------------------------------------------- /*----------------------V3--------------------------------------------------- v3.0.0 30/9/14 -Started a new life at Greasyfork. -Removed the USO updater, as it was dead. -The GeoKrety widget header change didn't make it live in V2. /*----------------------V2--------------------------------------------------- v2.0.2 5/10/13 -Prevented the GeoKrety widget header being detected as hidden text. v2.0.1 8/9/13 -Added updater. -Changed back to Chuck's namespace. v2.0.0 8/9/13 -The GC site had been changed so the include paths no longer worked. /*----------------------V1--------------------------------------------------- v1.3 3/1/11 # fix: Sometimes the Show Hidden Text button would show when no hidden text was present, updated method of checking # fix: Added to recongize new GC cache page address v1.2 11/18/10 # new: Finds words, hex and rgb values in white text # new: Changed to only highlight words and not the whole page # fix: Updated code to be more sufficient/effective v1.1.0 9/13/10 # new: Updated to catch white text if use style/font formatting # fix: Updated error if no Short/Long Description is on the page v1.0.0 9/10/10 *If you have previous version please uninstall before loading new version # new:Added auto updater # new: Updated to be able to show/hide hidden text # new: updated section of code so user can easily change text/background colors to their preference v0.0.1 9/7/10 # new: Initial Release (Still testing a couple of options) */ //----------------------SET USER VALUES------------------------------------------- // Use: color words: white, yellow, etc.... // HEX: #FF45FF ... etc... // or // RGB: rgb(255, 255, 255) ... etc.... // var fgcolor = 'white'; //Forground color for hidden text var bgcolor = 'red'; //Background color for hidden text var cm_fgcolor = 'white'; //Foreground color for HTML Comments var cm_bgcolor = 'green'; //Background color for HTML Comments // //----------------------END USER VALUES--------------------------------------- //Initialize Constants var found = false; var htmlshort=0, htmllong=0; //Check for short or long descriptions try{ htmlshort = document.getElementById('ctl00_ContentBody_ShortDescription').innerHTML; } catch(err){ } try{ htmllong = document.getElementById('ctl00_ContentBody_LongDescription').innerHTML; } catch(err){ } var html = htmlshort + htmllong; /********Find Hidden Text*********/ //Find Styles Colors allStyles = document.evaluate('//*[@style]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null); for(var i=0;i