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

End of Engineering and Begining of Web Raga

Finally my exams are over and here is the end of College Days. I don't know whether I will go for further studies or not, but surely I will try to do things out of the box.       We have started our work at e-Lightening Technologies and clients are just flowing to get their web presence. Definitely condition has been completely changed, two years back we used to convince each and every person coming to us why they should have a website for their business. But today people have agreed with this fact that if they want to be ahead of their competitors, they must have their online presence.  As far as this website is concerned, I have many plans. Soon we are going to hire 3 more Tech Bloggers to write for us. We are also going to have a seperate office for this website. We are now open for Guest Blogging. If you want to write for this website, please contact us using the contact form available on contact us page . From 14th June 2012, we will be p...

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...

Google's this Doodle is just Awwwsome!!!!

In celebration of Robert Moog’s 78th birthday, Google has created an epic Google Doodle to honor founder of Moog Music , pioneer of electronic music , best known as the inventor of the Moog synthesizer .The Doodle presents an interactive Moog synthesizer . Users can adjust dials on the synthesizer, turn switches on and off and play sounds on the keyboard. They can also record and playback their creations. Don't miss playing this with your keyboard!!!! Google is also showing a regular link of Google+ to share whatever music you have created.