Search code examples
firefoxfirefox-addon-webextensionsfirefox-57+greasemonkey-4

How to store Greasmonkey 4 Scripts in git


With the new update to Firefox 57 and Greasemonkey 4.0 it seems that the gm_scripts folder is no longer where the user.js scripts are stored.

Where are the scripts stored now?

Any suggestions for keeping these scripts in git?


Solution

  • Where are the scripts stored now?

    WebExtension API does not allow local file access so add-ons store data in their own storage area as an IndexDB at C:\Users\[Username]\AppData\Roaming\Mozilla\Firefox\Profiles\[Random].default\storage\default\moz-extension+++80728271-a923-4e37-a81d-68452721034c

    The negative issues are:

    • You cant manually edit them with your own editor and you have to use the GM interface to edit them.

    • If you uninstal GM, all script will be gone and reinstalling GM wont bring them back.

    • At the moment GM doesn't have an Import (to manually load scripts) or Export (to create backups). Although you can export all scripts by copying the folder above.

    You can copy scripts to Git and GM will (there are issues now) be able to get them from Git.

    The gm_scripts folder should still be in the Firefox profile folder. GM4 doesn't delete it but it wont be able to use it.

    https://superuser.com/questions/38093/where-are-the-greasemonkey-scripts-kept-in-portable-firefox

    In XP: C:\Documents and Settings\user\Application Data\Mozilla\Firefox\Profiles\xxxxxxxx.default\gm_scripts

    In Vista: c:\users\user\AppData\Roaming\Mozilla\Firefox\Profiles\xxxxxxxx.default\gm_scripts

    Select the profile you want to use (if you only have one, it should look something like xxxxxxxx.default). Finally select the gm_scripts folder.

    On a MAC: On a Mac, you can find your profile at ~/Library/Application Support/Firefox/Profiles