r/ViolentMonkey

Python-script for extracting ViolentMonkey userscripts from *.LDB file
▲ 14 r/ViolentMonkey+2 crossposts

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:

  1. 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)
  1. Download the script: https://pastebin.com/GtmEaGuQ . Name the file, like, vm_extractor_eng.pyw.

  2. Launch by double-clicking (in Windows). Probably works on Linux and Mac as well.

  3. 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. (jinjaccalgkegednnccohejagnlnfdag was the id for latest ViolentMonkey https://chromewebstore.google.com/detail/violentmonkey/jinjaccalgkegednnccohejagnlnfdag?pli=1.)

  4. 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.

  5. Click Save All and choose a folder.

  6. 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.

u/nothingxmc — 1 day ago

Violentmonkey MV3

I've converted Violentmonkey a couple of days ago to MV3 but it's not yet published even as a beta because it's still being tested and you can help.

  1. download the latest official CI build's zip with mv3 in its name like Violentmonkey-test-mv3-...... (if you don't have a github account use this nightly.link that allows downloading the latest artifact)
  2. unpack it and load as an unpacked extension in chrome://extensions
  3. enable Allow User Scripts in chrome://extensions -> details for Violentmonkey
  4. click the reload icon for the extension in that details page just in case

This will be a separate extension with its own id, but if you want to reanimate your currently installed Violentmonkey you can copy the "key" line from manifest.json of the old extension in your profile or use the one below of the official CWS jinjaccalgkegednnccohejagnlnfdag.

  1. edit manifest.json of the unpacked extension in an editor

  2. click right after { at the beginning of the file and paste the following text (don't forget the comma at the end):

    "key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvNNjtIVXIerv8ArGiIk2xHgO2/vmDXgMNPl5ok6zGTkndXXXzz1z5FyqThG41KTw+7Ax4UGid0Q0DVo3aHD/CLJTLBzWlDwpgM3vskBBtOSxYZhWDPFv5vgj+8UQ5sbArgJYdVtlVnv8wFkUfwqbSQZzsBY/VH6fXik0JaWBY09zAe4CvrTtr5ilq9HxVQM6bGTYnQ2aYtwAJIMWdvS1XR0za4mvyxwPn/IjLer54O1Z2atarGTmINVcoyzmO6C/EeMmblc+yb6AaInwKbNIKKjv+pZfxnUKfXfmKtfxhsOpvULLeo4Z45z+HU4I8RimO8MeiGbmrrLrnOPmRcz+0QIDAQAB",

u/tophf — 3 days ago