-
Notifications
You must be signed in to change notification settings - Fork 4
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: This page assumes familiarity with JavaScript and WebExtensions. Here be dragons!
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-bridgeFor 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.zipNext, you will need to manually install the packaged extension file:
- Firefox: Sign the extension file, then follow the "For advanced users" section of the Mozilla documentation.
- Chrome/Chromium: Visit chrome://extensions, enable "Developer mode", then drag-and-drop the
.zipfile.
To update the extension, run git pull in the repository and repeat the above process.