42

Where are Chrome/Tampermonkey userscripts stored on the filesystem?

I want to edit user scripts directly instead of using the hokey in-browser editor.

Brock Adams
  • 90,639
  • 22
  • 233
  • 295
Landon Kuhn
  • 76,451
  • 45
  • 104
  • 130
  • 1
    On Windows 7 they are installed here `C:\Users\cbrand\AppData\Local\Google\Chrome\User Data\Default` which is to say my user folder, the `AppData\Local` being the version of .files on Windows, which doesn't have any sort of "use .name to hide the file by default", and then etc. Maybe it's similarly nested on OSX? After that, there's a folder for each userscript, and a database of the active extensions. – jcolebrand Aug 07 '12 at 16:48
  • 22
    I disagree with the close on this, its absolutely related to programming. Knowing where to find the userscripts can be key to editing/programming them. – studgeek Jul 13 '13 at 22:52
  • 1
    I edited the answer to remove the OS-specific aspect since Brock's answer works across OSs. – studgeek Jul 13 '13 at 22:55
  • As said in this answer [https://superuser.com/a/1149989/398785] you can find them in : ```%LocalAppData%\Google\Chrome\User Data\Default\Local Extension Settings\dhdgffkkebhmkfjojejmpbldmpobfkfo\``` – MSS Jan 30 '20 at 17:35
  • See also [_How to update a userscript's code in Tampermonkey's extension storage directly_](https://stackoverflow.com/q/76451614/1744774). – Gerold Broser Jun 11 '23 at 17:13

1 Answers1

32

Tampermonkey scripts are super easy to update via the Tampermonkey tab. See the Tampermonkey FAQ, or just try it.

Tampermonkey scripts were stored in a special SQLite database and were/are not directly editable in file form.
Update: As of version 3.5.3630, Tampermonkey scripts are now stored using Chrome's extension storage. They are still not editable in file form, but the developer of Tampermonkey (derjanb) has helpfully made a Python script to extract them.


Chrome Userscripts (not the same as Tampermonkey scripts) are stored as follows, for the Chrome and Chromium browsers:

Windows XP:
  Chrome  : %AppData%\..\Local Settings\Application Data\Google\Chrome\User Data\Default\Extensions\
  Chromium: %AppData%\..\Local Settings\Application Data\Chromium\User Data\Default\Extensions\  

Windows Vista/7/8:
  Chrome  : %LocalAppData%\Google\Chrome\User Data\Default\Extensions\
  Chromium: %LocalAppData%\Chromium\User Data\Default\Extensions\

Linux:
  Chrome  : ~/.config/google-chrome/Default/Extensions/
  Chromium: ~/.config/chromium/Default/Extensions/

Mac OS X:
  Chrome  : ~/Library/Application Support/Google/Chrome/Default/Extensions/
  Chromium: ~/Library/Application Support/Chromium/Default/Extensions/

See this answer or this Google Groups thread.
Note that Chrome userscripts are automatically made into Chrome extensions with an auto-generated manifest.

However:

  1. Editing these files in place will not work. Chrome ignores and/or overwrites the changes.
  2. For Userscripts, set up your environment as in this answer, for easy editing and updating.
  3. Tampermonkey scripts are not stored the same way. They are stored, by Tampermonkey in a special SQLite database and are not directly editable that way. UPDATE: This was changed with version 3.5.3630, or so. See above.
Community
  • 1
  • 1
Brock Adams
  • 90,639
  • 22
  • 233
  • 295
  • 1
    Thanks. I was looking for a way to easily share them externally, so that others could download (via a link or cp script) It seems that's not possible. – isaaclw Oct 14 '13 at 18:49
  • It is possible to export using the utilities tab on the dashboard – jcuenod Sep 26 '14 at 09:04
  • 9
    Tampermonkey scripts are now stored at Chrome's extension storage. In case anybody needs it: I wrote a python script to extract them. https://gist.github.com/derjanb/9f6c10168e63c3dc3cf0 – derjanb Sep 03 '15 at 06:56
  • Thanks, @derjanb . Rolled that info into the answer. – Brock Adams Sep 04 '15 at 22:21
  • Can someone update this for edge/opera etc? – Megachip Jun 11 '17 at 18:05
  • 3
    @Megachip, it's not that easy, and I personally refuse to touch *Edge*. This question is specifically targeted to Chrome. ... If you need to, open a new question (for Opera). – Brock Adams Jun 11 '17 at 18:39
  • Any idea where for firefox? – Douglas Gaskell Oct 15 '19 at 04:46
  • 1
    The Python script didn't work for me. First I tried running it directly on Windows and it couldn't import leveldb even though I had installed it, then I tried running it on Linux using a Windows subsystem for Linux and it ran without errors but gave me an empty output. – Donald Duck Oct 31 '21 at 18:56
  • See also [_How to update a userscript's code in Tampermonkey's extension storage directly_](https://stackoverflow.com/q/76451614/1744774). – Gerold Broser Jun 11 '23 at 17:12