Monday, March 8, 2010

Introduction to Greasemonkey

What is the need?
Sometimes it is needed that you want to execute some scripts automatically at your page using some client side language (e.g. Javascript). Some good examples are like Mob Wars, Mafia wars or FarmVille where attacks etc are automatically done with certain defined rules . Another example may be automatically retrieving data from other sites to make two sites more interconnected.

What is Greasemonkey?
"Greasemonkey is a Firefox extension that allows you to write scripts that alter the web pages you visit." Using Greasemonkey extension many script can be executed as a hack to the Firefox to make your work smoother.

How to install?
Download from http://www.greasespot.net/, install and restart the browser (Firefox). Scripts can be installed then after. It name must end in .user.js
http://dunck.us/collab/GreaseMonkeyUserScripts is the script repository containing hundreds of scripts

Example please!
// ==UserScript==
// @name Hello World (helloworld.user.js)
// @namespace http://vishnu-agarwal.blogspot.com
// @description example script to alert "Hello world!" on every page
// @include *
// @exclude http://timir126.blogspot.com/*
// ==/UserScript==


Further help?

No comments:

LinkWithin

Related Posts with Thumbnails