Learn Greasemonkey
Moderator: Tech Team
Forum rules
Please read the Community Guidelines before posting.
Please read the Community Guidelines before posting.
Learn Greasemonkey
Hey i want to pick up programming in greasemonkey but chip's link doesnt work for me 
Re: Learn Greasemonkey
much obliged! 
Re: Learn Greasemonkey
No worries.
Feel free to post any queries you have - or any other good learning sites in this thread.
C.
Feel free to post any queries you have - or any other good learning sites in this thread.
C.

Highest score : 2297
-
Dako
- Posts: 3987
- Joined: Sun Aug 26, 2007 9:07 am
- Gender: Male
- Location: St. Petersburg, Russia
- Contact:
Re: Learn Greasemonkey
Very good book about Greasemonkey
http://diveintogreasemonkey.org/
It is available online or as PDF or HTML download.
http://diveintogreasemonkey.org/
It is available online or as PDF or HTML download.

Re: Learn Greasemonkey
I just looked through the book, and it's a bit outdated (as it says on the page you're linking to).
Some updated basics:
- A greasemonkey script is mainly an extra javascript-file that is executed on the page with a few extra limitations and possibilities.
There are enough resources available on javascript, so I won't dive into that (though Douglas Crockford's lectures are a good place to start if you already know how to write programs).
- Extra possibilities include saving information (though this can be done through localStorage these days) and doing cross-site URL requests.
- Small bits of code (for finding a certain element or doing some basic operations) are best to check through the firebug console.
- Best way to debug: actually install the script in chrome, and use the Chrome debugger to set breakpoints and check certain objects.
- second-best way: Install/use firebug in firefox, and use its logger through unsafeWindow.console.log(element). This will show the element/object in the firebug console, which can be used to inspect further.
Unfortunately the debugger in Firebug doesn't work for greasemonkey scripts at the moment.
- The main difference between firefox and chrome scripts: Chrome doesn't allow the script to interfere with scripts on the page in any way.
Greasemonkey does (mainly through unsafewindow), but that is thought to be a bad practice. Chrome also doesn't allow cross-site URL requests, though there are ways around that.
Some updated basics:
- A greasemonkey script is mainly an extra javascript-file that is executed on the page with a few extra limitations and possibilities.
There are enough resources available on javascript, so I won't dive into that (though Douglas Crockford's lectures are a good place to start if you already know how to write programs).
- Extra possibilities include saving information (though this can be done through localStorage these days) and doing cross-site URL requests.
- Small bits of code (for finding a certain element or doing some basic operations) are best to check through the firebug console.
- Best way to debug: actually install the script in chrome, and use the Chrome debugger to set breakpoints and check certain objects.
- second-best way: Install/use firebug in firefox, and use its logger through unsafeWindow.console.log(element). This will show the element/object in the firebug console, which can be used to inspect further.
Unfortunately the debugger in Firebug doesn't work for greasemonkey scripts at the moment.
- The main difference between firefox and chrome scripts: Chrome doesn't allow the script to interfere with scripts on the page in any way.
Greasemonkey does (mainly through unsafewindow), but that is thought to be a bad practice. Chrome also doesn't allow cross-site URL requests, though there are ways around that.
Re: Learn Greasemonkey
ill make sure to look into all of this once AP testing is over 