Skip to main content

Greasemonkey


Greasemonkey is a Mozilla Firefox extension that allows users to install scriptsthat make on-the-fly changes to HTML web page content on the DOMContentLoaded event, which happens immediately after it is loaded in the browser (also known as augmented browsing).
As Greasemonkey scripts are persistent, the changes made to the web pages are executed every time the page is opened, making them effectively permanent for the user running the script.
Greasemonkey can be used for adding new functions to web pages (for example, embedding price comparisons within shopping sites), fixing rendering bugs, combining data from multiple webpages, and numerous other purposes.

Technical details

Greasemonkey user scripts are written in JavaScript and manipulate the contents of a web page using the Document Object Model interface. Scripts are site-specific and written by hand. userscripts.org maintains a database of Greasemonkey scripts, and for each, lists the URLs of web pages to which the script pertains. When the user visits a matching website, Greasemonkey invokes the relevant scripts, which can modify a webpage in any way JavaScript could. Greasemonkey scripts can also poll external HTTP resources via a non-domain-restricted XMLHTTP request. Scripts are named somename.user.js, and Greasemonkey offers to install any such script when a URL ending in that suffix is requested. Greasemonkey scripts contain optional metadata, which specifies the name of the script, a description, relevant resources to the script, a namespace URL used to differentiate identically named scripts, and URL patterns for which the script is intended to be invoked or not.
Writing a Greasemonkey script is similar to writing JavaScript for a web page, with some additional allowances such as cross-site XMLHttpRequests. Compared to writing a full-fledged Firefox extension, user scripting is a very modest step up in complexity from basic web programming. However, Greasemonkey scripts are limited due to security restrictions imposed by Mozilla's XPCNativeWrappers. For example, Greasemonkey scripts do not have access to many of Firefox's components, such as the download manager, I/O processes or its main toolbars. Additionally, Greasemonkey scripts run per instance of a matching webpage. Because of this, managing lists of items globally is difficult. However, script writers have been using cookies and Greasemonkey even offers APIs such as GM_getValue and GM_setValue to overcome this.

Typical Greasemonkey scripts

Users have written scripts that:
  • Auto fill forms.
  • Alter the formatting of text, borders, graphics, etc. (For example, highlight first-run programs in a TV listing.)
  • Remove specific content, such as advertising, popups, even whole sections of a page. (For example, filter specific posters from a message board site.)
  • Alter content and layout beyond that which the page author considered. (For example, add floating elements, make elements collapsible, etc.)
  • Add links, buttons, or any other type of HTML element anywhere on the page. (For example, embed Google Reader into Gmail, thus providing an RSS feed option.)
  • Enhance the content of pages by retrieving correlating information from related pages on the same site, or other sites. (For example, list the prices of competing retailers' for the same product.)
  • In general, take advantage of extended JavaScript behavior to add previously non-existent functionality to pages. (For example, collate RSS feeds on the current page into a floating panel.)
 To get more details about Greasemonkey and to download it .. please visit http://www.greasespot.net/

Popular posts from this blog

How to write a bach file or a batch job?

If your are connected with world of programming, you might have heard this word " Batch File ". A batch file is used to execute a no of operations or a list of commands one after the other often requiring no user input. A no of operations are batched in a file to be executed sequentially when we run that file. In Microsoft Windows Operating system a batch file is a file saved with .bat extension while in other operating systems like Unix and Linux it can be written as a command file shell script. Batch files are often used to load programs, run multiple processes at a time, and perform common or repetitive tasks. For example, a batch job could be used to back up many files on a computer system, process log files, run a series of calculation commands, run multiple system diagnostic processes, or any number of other things that require multiple commands to be run. A big advantage of a batch job is that it can be started at any time and left alone until t...

Adding Password to Microsoft Word Document

Recovering Deleted Files, Pictures & Videos

  So many times we accidently delete some important files, pictures or videos. Sometimes we loose files because of unexpected system failure  ( ultimately causing system format). We can get our deleted files back using Recovery Softwares/Utilities.  Even though a file was deleted there is a good chance that contents of the file are still around.  When a file is deleted the contents of the file are not removed. Only a pointer to the file in the file system table is deleted.   It is very important to immediately stop writing to the storage device that previously contained your files/pictures so that the old file contents are not overwritten.  For example, don’t take any more pictures with your digital camera because new pictures will overwrite the deleted files. HOW TO RECOVER DELETED FILES???? Step1: You will need to use a utility to recover your lost files. I like to use a free ut...