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, install and restart the browser (Firefox). Scripts can be installed then after. It name must end in .user.js is the script repository containing hundreds of scripts

Example please!
// ==UserScript==
// @name Hello World (helloworld.user.js)
// @namespace
// @description example script to alert "Hello world!" on every page
// @include *
// @exclude*
// ==/UserScript==

Further help?

No comments:


Related Posts with Thumbnails