1 / 7

Introduction To Greasemonkey

Introduction To Greasemonkey. What is Greasemonkey?. A Firefox extension which allows a user to install scripts which will alter a web page on-the-fly. Useful for adding new functionality, fixing bugs, removing unwanted content, etc. User Scripts.

sana
Download Presentation

Introduction To Greasemonkey

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction To Greasemonkey

  2. What is Greasemonkey? • A Firefox extension which allows a user to install scripts which will alter a web page on-the-fly. • Useful for adding new functionality, fixing bugs, removing unwanted content, etc.

  3. User Scripts • Greasemonkey on its own doesn’t do anything. A user script must be installed in order to alter page content. • A user script must end in the “.user.js” file extension. • A user script can be installed via the Tools->New User Script menu item or by browsing to the script in Firefox.

  4. User Script Metadata • Each script has a metadata section to tell Greasemonkey about itself. // ==UserScript== // @name TestScript // @namespace tag:hci.ucsd.edu,2001-06-05:ex // @description A Test script // @include http://hci.ucsd.edu/* // ==/UserScript==

  5. GM API • Greasemonkey also supports some additional API in addition to JavaScript • GM_log – log messages to JavaScript Console • GM_getValue – get script specific config value • GM_setValue – set script specific config value • GM_registerMenuCommand – add a menu item to the User Script Commands submenu • GM_xmlhttpRequest – make an arbitrary HTTP request

  6. Lets Install Some Scripts • Hello World // ==UserScript== // @name TestScript // @namespace tag:hci.ucsd.edu,2001-06-05:ex // @description A Test script // @include http://hci.ucsd.edu/* // ==/UserScript== alert(“Hello World”);

  7. Useful Links • http://greasemonkey.mozdev.org • http://diveintogreasemonkey.org • http://dunck.us/collab • http://greaseblog.blogspot.com • http://www.oreilly.com/catalog/greasemonkeyhks

More Related