javascript - How to hide certain elements using Greasemonkey? -


i'm looking hide elements using greasemonkey. links this:

<a href="earn-google-circles.php" target="_blank" );"="">view</a> 

or images this:

<img src="http://www.somesite.org/img/icon/earn-google-circles-435912.png" alt="circle" title="google circle" height="18px" width="50px"> 


of course, it's part of larger div, div can't hidden because hide other things don't want hidden.

so, there way hide these elements using greasemonkey?
(editor's note: applies tampermonkey)

to hide manner of google circles links (or images), use greasemonkey/tampermonkey script this:

// ==userscript== // @name     _hide annoying links // @include  http://your_server.com/your_path/* // @require  http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js // @require  https://gist.github.com/raw/2625891/waitforkeyelements.js // @grant    gm_addstyle // ==/userscript== /*- @grant directive needed work around design change     introduced in gm 1.0.   restores sandbox. */ waitforkeyelements (     "a[href*='earn-google-circles'], img[src*='earn-google-circles']",     hidenode );  function hidenode (jnode) {     jnode.hide (); } 

this gets both static and ajax-loaded instances.

see choosing , activating right controls on ajax-driven site tips on choosing jquery selector.

reference:


Comments