
Python-script for extracting ViolentMonkey userscripts from *.LDB file
Recently ViolentMonkey got disabled in Brave browser, making impossible to run neither extract userscripts you made while having the extension.
I wrote a windowed Python script for extracting the scripts from *.ldb database into separated *.js files. (After installing, don't launch *.js files directly in the Windows – you should open them as text files and copy-paste contents of each into a new script of... OrangeMonkey or something.)
How to use it:
Install Python, if you don't have https://www.python.org/;
Installing dependencies
-------------------------
pip install tkinterdnd2 # for drag-and-drop in the window (optional)
pip install python-snappy # for decompressing compressed blocks (optional)
# or
pip install cramjam # alternative to python-snappy (optional)
Download the script: https://pastebin.com/GtmEaGuQ . Name the file, like,
vm_extractor_eng.pyw.Launch by double-clicking (in Windows). Probably works on Linux and Mac as well.
Load the file (by drag-and-dropping or with Open File button). The location is:
C:\Users\Username\AppData\Local\BraveSoftware\Brave-Browser\User-Data\Default\Local Extension Settings\jinjaccalgkegednnccohejagnlnfdag\000005.ldb, or similar. (jinjaccalgkegednnccohejagnlnfdagwas the id for latest ViolentMonkey https://chromewebstore.google.com/detail/violentmonkey/jinjaccalgkegednnccohejagnlnfdag?pli=1.)It's recommended to enable the "Show only the latest version of each script". As you can see, old versions of scripts also stored in the database; even those that you completely deleted, still will appear – if you disabled the checkbox.
Click Save All and choose a folder.
Using your new scripts engine (like OrangeMonkey), create new userscript for every file and copy-paste the content. Notice that for make OrangeMonkey work, you should enable "Allow User Scripts" here: extensions button → Manage extensions → Orange Monkey's "Details" → enable Allow User Scripts; then you have to relaunch browser, that is close all browser's windows then open the browser again.