0

... such being able to use my preferred IDE for developing and avoiding C&Ping the code into TM's Edit window very, very often repeatedly?

I found /home/<user>/.mozilla/firefox/t1b9jtvd.default-release/storage/default/https+++www.tampermonkey.net/ls/data.sqlite and opened it with FF's SQLite Manager but didn't find a table for scripts there.

According to an answer to Where are Chrome/Tampermonkey userscripts stored on the filesystem?:

Update: As of version 3.5.3630, Tampermonkey scripts are now stored using Chrome's extension storage.

But where are they stored in FF and how to access them from the outside world there? And, how to access Chrome's extension storage from the outside world?

Gerold Broser
  • 14,080
  • 5
  • 48
  • 107

1 Answers1

2

Option The Firste (online)

Use the new Tampermonkey Editors extension.

As of version 4.19.0, Tampermonkey now allows you to edit your Tampermonkey scripts using VS Code Online. Here's how:

  1. Install the Tampermonkey Editors extension
  2. That's it.

After installation, when you click the "Tampermonkey Editors"' icon it will take you to vscode.dev and a "folder" with all installed Tampermonkey scripts should be automatically opened.

A few notes:

a. Your scripts are grouped by Namespace (the // @namespace line)
b. Some essential extensions from the VS Code desktop app do not work (for e.g., Allessandro Fragnani's essential "Numbered Bookmarks" extension is not available - in fact, no bookmark extension is available as of this writing. No bookmarks. Auuugh!)


Option The Seconde (local)

You can also use your locally-installed VSCode instance to edit your scripts, using this (older) method - however, this might only work on Chromium browsers because of step-the-first:

  1. Go to your Chrome extension settings and turn on "Allow access to file URLs".
  2. In the Tampermonkey editor, all you need is a blank script that //requires the js file that contains your actual code.
  3. You can use VScode to edit that js file.

Extra note: Once you can edit local files, this also opens up the ability to use build systems like webpack or whatever else you fancy. Minify your script. Split it into different files. Transpile from typescript. Go wild.

References:

https://github.com/Tampermonkey/tampermonkey/issues/1654

https://www.tampermonkey.net/changelog.php#v4.19.0

cssyphus
  • 37,875
  • 18
  • 96
  • 111
  • Thanks for these valuable infos. My preferred IDE, however, is Eclipse, not VS Code (mainly I'm a Java architect/developer). And I just checked and didn't find a TM plugin for it. Well, going to install VS Code for Linux then... – Gerold Broser Jun 13 '23 at 14:32
  • 1
    @GeroldBroser--OnStrike Hi Gerold - you can actually edit in Eclipse also, using the 2nd option. Using that method, it doesn't matter which IDE you use. However, I would give VS Code a try - there's a reason why even M$ disparagers (like myself) are singing its praises. – cssyphus Jun 13 '23 at 17:36
  • 1
    @GeroldBroser--OnStrike Also, thanks for upvoting that GH request of mine - no matter how convenient it is to use an external IDE, I still end up frequently editing scripts using the built-in editor and drenching my keyboard with tears for lack of bookmarks and highlightable lines... (On the desktop version of VS Code, Alessandro Fragnani's [Numbered Bookmarks](https://marketplace.visualstudio.com/items?itemName=alefragnani.numbered-bookmarks) extension, allows you to [back-highlight lines](https://stackoverflow.com/a/55875648/1447509) in your code. Super useful. – cssyphus Jun 13 '23 at 19:23