My favorites | Sign in
Project Logo
                
Search
for
Updated Jan 21, 2007 by zboogs
ContributingToGreasemonkey  

Want to help with Greasemonkey? Great! We need all the help we can get. This page will tell you everything you need to know to get started.

Decide what to to

If there is something in particular you want to change in Greasemonkey, then say "Huzzah!" - you're done with this part.

Otherwise, you may want to browse the bug list to find something that needs doing.

Announce your intentions

This step is very important. You should communicate what you intend to do with the Greasemonkey community before you begin doing it. If you don't do this, we may request significant changes before accepting it, or we may not accept it at all.

To announce your intentions, join greasemonkey-dev@googlegroups.com at http://groups.google.com/group/greasemonkey-dev and send us a note saying what you want to change. Include the link to the bug entry if applicable.

Get the source code

Greasemonkey source code is managed with Subversion (aka "SVN") at https://greasemonkey.googlecode.com/svn/.

To use SVN, you need to install an SVN client and "check out" the source code. Here is a quick explanation of how to do this on various platforms. For more information, there is tons of documentation on using SVN available online.

Windows

  • Install TortoiseSVN
  • Create a folder to store your Greasemonkey files in. For the sake of conversation, let's call this folder 'greasemonkey'.
  • Right click on the greasemonkey folder and select 'Checkout' from the SVN menu
  • Paste this URL into the textbox labeled "URL of Repository": https://greasemonkey.googlecode.com/svn/trunk/
  • Press OK. All the greasemonkey files will be downloaded into the folder.

Mac

TODO

Linux

Implement your change

Greasemonkey is easy to hack on because it has a quick edit/test cycle. Here is how to set it up.

Set up your development profile

You will want to have a separate Firefox profile for developing Greasemonkey. It's useful because you can have your regular Firefox profile open for reading email and checking documentation without having to constantly restart it when you want to test your changes to GM.

Also, if something you change happens to corrupt your profile, you won't destroy your main one :-)

To set up a new Firefox profile, you can use the regular Firefox Profile Manager, but I think it is easier to create the directory yourself:

Windows

  1. Create a new folder anywhere you want, let's say "c:\gmprofile".
  2. Inside the folder, create a new folder, called "extensions".
  3. Inside that folder, create a new text file called {e4a8a97b-f2ed-450b-b12d-ee082ba24781} (including the curly braces). It's important the file not have ".txt" at the end.
  4. Open the text file and enter the path to the src folder inside your Greasemonkey checkout. So if you checked out to c:\greasemonkey then you would enter c:\greasemonkey\src inside the text file.
  5. Close any open Firefox windows
  6. Open a command prompt by going to Start > Run > and typing "cmd".
  7. Run firefox with this command: MOZ_NO_REMOTE=1 c:\program files\firefox\firefox.exe -profile c:\gmprofile.

Obviously, you will need to change the path to firefox.exe to be correct for your system. You can find the path to firefox.exe by right-clicking on any firefox icon and showing it's properties.

Linux

  1. mkdir -p gmprofile/extensions
  2. echo 'path/to/greasemonkey/checkout/src' > gmprofile/extensions/{e4a8a97b-f2ed-450b-b12d-ee082ba24781}
  3. MOZ_NO_REMOTE=1 firefox -profile gmprofile

Mac

TODO

The MOZ_NO_REMOTE=1 part of the command allows other firefox profiles to be run at the same time. So now, you should be able to open your regular firefox at the same time and use it to browse docs or check mail or whatever.

All platforms

Your development cycle will now be something like this:

  1. Edit files in your greasemonkey source checkout
2. Restart firefox (using MOZ_NO_REMOTE=1... command) 3. Test change 4. Rinse, repeat

No separate compile step is necessary.

Send your changes for review

Changes to any open source project are communicated by way of something called a "patch" or "diff" file. This is a special file that shows the changes you have made on your private copy of Greasemonkey. You can generate one using your Subversion client.

  • Windows: Right-click on the greasemonkey folder and select svn > diff
  • Linux: from the root source directory: svn diff > /tmp/greasemonkey.patch
  • Mac: TODO

Take your patch file and send it to greasemonkey-dev with a description of what you have done. There will hopefully be some feedback from the community. Continue in an iterative fashion, collecting feedback, making changes, etc, until everyone agrees that you are done.

Once this occurs, the Greasemonkey admins (currently just Aaron) will give you commit access to the repository. Then you can use this command to submit your change:

svn commit

A new Greasemonkey version is released on the first Thursday of every month, as long as there are changes to release.


Sign in to add a comment
Hosted by Google Code