Skip to content

Modifying the extension

Avery Crespi edited this page Dec 5, 2020 · 5 revisions

This page explains how to modify the VTT Bridge extension.

Prerequisites: Building the extension

Warning: If you create your own version of the extension, you will NOT receive automatic updates

If you want to modify the extension, you can create your own version of VTT Bridge.

# Clone the repository
git clone https://github.com/averycrespi/vtt-bridge.git && cd vtt-bridge

For example, you can modify the extension to support your personal DMV server.

// Edit the "content_scripts" array in `manifest.json`.
// For each domain you want to support, add a string to the `matches` array.
content_scripts": [
    {
-     "matches": ["*://www.dungeonmastersvault.com/pages/dnd/5e/characters/*?frame=true"],
+     "matches": [
+           "*://www.dungeonmastersvault.com/pages/dnd/5e/characters/*?frame=true",
+           "*://example.com/pages/dnd/5e/characters/*?frame=true",
+     ],
      "js": ["dist/polyfill.js", "dist/dmv.js"],
      "css": ["dist/dmv.css"]
    },
    {
      "matches": ["*://app.roll20.net/editor*"],
      "js": ["dist/polyfill.js", "dist/roll20.js"],
      "css": ["dist/roll20.css"]
    }
  ]

After editing manifest.json, you must rebuild the extension with your changes.

# Build the extension package
yarn build

# Find the packaged extension file in `web-ext-artifacts/`
ls web-ext-artifacts
# e.g. vtt_bridge-1.2.3.zip

Next, you will need to manually install the packaged extension file:

  • Firefox: Follow the "For advanced users" section of the Mozilla documentation.
  • Chrome/Chromium: Visit chrome://extensions, enable "Developer mode", then drag-and-drop the .zip file.

Clone this wiki locally