My small greasemonkey tutorial

in Ideas and script requests
Subscribe to My small greasemonkey tutorial 9 posts, 6 voices

Alex Netkachov Scriptwright

I've wrote a small tutorial on how to hide the unwanted content on the Web page using Greasemonkey. May be interested to you if you are creating your first script.

Mikado Scriptwright

Great addition to what you wrote would be explaining that GreaseMonkey in fact poorly fits this task and recommending Stylish instead.

Oscar's ... Scriptwright

While it certainly makes sense to use Stylish to do what the OP said, GM however can be used to do similar things in much more sophisticated ways. It is not always possible to hide things using Stylish, as there is not always a way to distinguish between tags as often no unique ID or CLASS is given, which can mean removing content you want along with content you don't. I think a more useful GM tutorial along these lines would look for text within some certain types of tags, and then decide to hide what is between those tags.

For example. How would you tidy up this this:

<div>I want to be seen</div>
<div><h1>I am always the same</h1>I am different every time but want to be hidden</div>
<div>I also want to be seen</div>

to give the result:

<div>I want to be seen</div>
<div>I also want to be seen</div>

Alex Netkachov Scriptwright

Agree, GM is fairly more customizable then Stylish. It is the swiss knife when Stylish is a hammer.

The Dot Scriptwright

css pseudo selectors? not always but loads of times :)

Oscar's ... Scriptwright

Hey, thanks for that The Dot! I had no idea how how more complex CSS selectors were than I first thought (I've only ever used TAG.class or TAG#id), until I googled after seeing your somewhat cryptic message.

I've not been able to block the huge list of "Users Currently Online" at the bottom of the ubuntuforums website. The following in Stylish did the trick:

td[class="alt1"] > div.smallfont > div {display:none !important}

The Dot Scriptwright :D

pity firefox 3 is *stilllll* behind

dob Scriptwright

var x in array shouldnt be used, that's only for objects. use for (var x=0; x<y.length; x++) instead.

m231117 Scriptwright

Oh please re-up your tutorial.
I think it was exactly what I am looking for.
Would be awsome!