Home » Internet Tools

How To Run Greasemonkey Scripts In Google Chrome

Greasemonkey (and some other great tools) makes Firefox a really open browser. Many people have not migrated to Google Chrome just because of Greasemonkey add-on. And, here is a great news for all those people who use Chrome : Now Chrome supports Greasemonkey!

But, there are some limitations as well (as with Opera — which also supports some greasemonkey scripts). Chrome does not support @exclude, @require, @resource, unsafeWindow, or any of the special GM_* APIs.

Well, here is how to run userscripts in chrome :

  • Add this flag to Google Chrome launcher :

--enable-user-scripts

For this right click on the shortcut icon, select properties > shortcut.

  • Now, create a folder in your user data directory. Name it as User Scripts.

If you don’t know the location of your user data directory, this article can help you. By default (for Win XP) it should be here :

C:\Documents and Settings\windows-username\Local Settings\Application Data\Google\Chrome

  • Save your all GM scripts in this folder. Please ensure the files have .user.js extension.

If you want to import all userscripts from Firefox — you need to do it manually. We have shown you the way to backup your Greasemonkey scripts. Just navigate to your GM script folder in Firefox data directory as describe in this post. Now, you can copy and paste every script’s file manually. :)

  • And, you are done! Restart the chrome — and visit any related site. It is quite possible that your favorite GM Script will do the magic.

Now another important fact : Chrome supports “Early Injection” – the ability to run scripts very early in the page’s lifecycle. In Firefox, userscripts run after page load. But in chrome, you can set it to run before page load. For this, you need to add an extra line in scripts meta data section :

// @run-at document-start

Cool!! :)

Script NOAddict in Chrome

Greasemonkey Script NoAddict in Chrome


[ ps - I m using Chrome 4.0.206.1 ] / [ source ]

>>> Learn about Mozilla Service Week (September 14 -21, 2009)

Written by on 13 September 2009 in Internet Tools. Updated on 24 February 2010.
About The Author
Arpit is a tech enthusiast and freelance developer. Read more ยป
Contact him at arpit@techraga.com. Follow on Twitter.

Read more on , , ,

4 Responses to How To Run Greasemonkey Scripts In Google Chrome

  1. nibras says:

    i still cannot run greasemonkey scripts. do i need to install greasegoogle??

  2. Arpit Kumar says:

    @nibras: Chrome does n’t support all gm functions yet.

  3. nibras says:

    yes i got the solution. running older version of chrome with greasegoogle. working fine

  4. Pingback: Change User agent in Chrome

Leave a Reply

Your email address will not be published. Required fields are marked *