Help Newbie Learn

in Script development
Subscribe to Help Newbie Learn 5 posts, 5 voices



Dennis M. User

I am just trying to learn the capabilities of scripts.

Let's say that a site http://www.xxx.com has the following CSS:

#categories #cat-undo ul li a:hover {text-decoration:underline;}

I decide that instead of underline I want a line-through. How would I do this?

This is just an example. I really want to play with various page widths at a later time.

 
ddill65 User

What has been most helpful to me Dennis, is to go to the Scripts section and just start reading them. When you find one that approximates what you want to do or is in any way similar, install it and try it out. Then look at the source and see how it accomplishes its task and try to replicated it on a page of your own.

I found that this allowed me to start having small successes almost immediately. I am still working on the bigger successes. ;P

 
alien_scum Scriptwright

for adding CSS use the GM_addStyle function, eg

GM_addStyle("#categories a:hover {text-decoration: line-through !important}");

however if you just want to change the CSS use the stylish extension.
also check out dive into grease monkey and the GreaseSpot wiki.

 
Joel H Scriptwright

Edit: alien_scum beat me here by less than one minute, so you can feel free to read or ignore this.

If you want a general introduction to greasemonkey and a few simple things about how to write scripts, I would recommend reading http://diveintogreasemonkey.org/ This site will teach you about what you can do with greasemonkey and how; there is a section in there on CSS which you can skip to with the table of contents if you're impatient, but you should probably read the whole thing.

-Joel

 
Henrik N Admin

Do note that Dive into Greasemonkey is a bit out of date. It probably still reflects what you can achieve with GM well, but some details may be off. The wiki is a more up-to-date reference.