Tampermonkey: [Suggestion] [Firefox] Import userscripts from Greasemonkey

Created on 18 Jul 2016  路  8Comments  路  Source: Tampermonkey/tampermonkey

I have been using Tampermonkey for a few years in Chrome and now recently in Opera as well, and I've genuinely been satisfied. I am pleased that this extension is available on Firefox as well, as I've been wanting to replace Greasemonkey for some time now.

Currently in order to import my existing userscripts from Greasemonkey, I need to access the gm_scripts folder on my Firefox profile, zip it up and then import it into Tampermonkey. It would be nice if I could import these scripts directly from the Tampermonkey interface. I am wondering if this is possible.

(And by the way, thanks for fixing the excessive font size as well, that was the only reason why I haven't been using Tampermonkey in Firefox until now.)

enhancement

Most helpful comment

Unfortunately there is not automatic way to this, but you can import the scripts manually this way:

  • find your Firefox profile folder
  • enter the 'gm_scripts' folder
  • search for all files ending up on '.user.js'
  • zip them
  • import the zip at the "Utilities" tab at the Tampermonkey options page

All 8 comments

Speaking of which, importing from a zip file isn't working--I press the Import button and nothing happens.

I'll check if this is possible. At the moment there is not file:// access at FF, but maybe there is another way to achieve this.

Hello, I am brand new to TM and found this with Google. I see it's still open, is there another way to export a zip/json from GM and use the normal TM import?

I forgot to mention I'm using Firefox, so can't use the file access options mentioned in the Chrome section of the FAQ.

Unfortunately there is not automatic way to this, but you can import the scripts manually this way:

  • find your Firefox profile folder
  • enter the 'gm_scripts' folder
  • search for all files ending up on '.user.js'
  • zip them
  • import the zip at the "Utilities" tab at the Tampermonkey options page

I used the following to quickly zip all the userscripts
find /path/to/gm-scripts-folder -name "*.user.js" -type f -print | zip -j import-into-tampermonkey.zip -@

To limit the userscripts to those modified in last 200 days, add the mtime arg to the above like so:
find . -name "*.user.js" -mtime -200 -type f -print | zip -j import-into-tampermonkey.zip -@

Finally, if you happen to have userscripts with the same names, then to zip up only the last found script add filtering via awk
find . -name "*.user.js" -type f -print | awk -F/ '{a[$NF]=$0}END{for(i in a)print a[i]}' | zip -j import-into-tampermonkey.zip -@

The -j arg to zip creates a zip without any folders.

(See this)

@derjanb import from zip is not working for me on FF56

@derjanb import from zip is not working for me on FF56

@d3athrow This is working fine here with FF 56.0 (64-bit) and TM v4.5.5660. What Tampermonkey version do you use?

Was this page helpful?
0 / 5 - 0 ratings