Fix BetterDiscord plugin loading/reloading and VFS viewer syntax highlighting #2

Open
goproslowyo wants to merge 1 commit from goproslowyo/local-bd-compat-fixes into main
goproslowyo commented 2026-09-02 07:04:12 -05:00 (Migrated from github.com)

Describe your Changes

Fix BD compatibility issues that prevented plugins from loading correctly from the virtual filesystem.

So I was having trouble with the BD compatibility layer not loading the better Discord plugins that I was adding. So I added a some defensive code that fixes the loading of plugins and also fixes the syntax highlighting in the BD compat VFS viewer section. Changes are as follows:

  • Avoid redefining DiscordNative.clipboard when the property already exists.
  • Fixed plugin reload handling for plugins stored in the BD virtusl filesystem.
  • Remove stale generated plugin entries before reconverting a reloaded plugin.
  • Prevent reload failures caused by an undefined PluginMeta.
  • Also fixe the reload button in the BetterDiscord file viewer.

For now, I'm just maintaining a local branch with my patches on it that I can rebase on top of your upstream from when you make changes, but I figured I would contribute the fixes upstream and you can decide whether or not you want them or if you'd like to fix them some other way then feel free to close the PR. Thanks!!

Screenshots (if applicable)

console output from clicking the reload plugin button

console output from clicking the reload plugin button

screenshot shows working syntax highlighting in VFS veiwer

screenshot shows working syntax highlighting in VFS veiwer

Checklist before submitting

  • I have read the CONTRIBUTING.md file and made sure this pull request complies with it
  • This pull request was written by me, and not an AI agent
<!-- We do not accept PRs that were created by AI. You will be permanently blocked with no further warning if you submit AI generated PRs. Also do not use AI in communication, it makes me ill --> ## Describe your Changes Fix BD compatibility issues that prevented plugins from loading correctly from the virtual filesystem. So I was having trouble with the BD compatibility layer not loading the better Discord plugins that I was adding. So I added a some defensive code that fixes the loading of plugins and also fixes the syntax highlighting in the BD compat VFS viewer section. Changes are as follows: * Avoid redefining DiscordNative.clipboard when the property already exists. * Fixed plugin reload handling for plugins stored in the BD virtusl filesystem. * Remove stale generated plugin entries before reconverting a reloaded plugin. * Prevent reload failures caused by an undefined PluginMeta. * Also fixe the reload button in the BetterDiscord file viewer. For now, I'm just maintaining a local branch with my patches on it that I can rebase on top of your upstream from when you make changes, but I figured I would contribute the fixes upstream and you can decide whether or not you want them or if you'd like to fix them some other way then feel free to close the PR. Thanks!! ## Screenshots (if applicable) ### console output from clicking the reload plugin button <img width="1887" height="173" alt="console output from clicking the reload plugin button" src="https://github.com/user-attachments/assets/fdb19df6-139c-4e8a-8abd-1283352196c8" /> ### screenshot shows working syntax highlighting in VFS veiwer <img width="796" height="863" alt="screenshot shows working syntax highlighting in VFS veiwer" src="https://github.com/user-attachments/assets/74f1ca6c-08d0-443a-a09c-98ea7a8fcaf4" /> ## Checklist before submitting <!-- Hint: [x] this is how to check boxes --> - [x] I have read the [CONTRIBUTING.md](./CONTRIBUTING.md) file and made sure this pull request complies with it - [x] This pull request was written by me, and not an AI agent
This pull request is broken due to missing fork information.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'goproslowyo/local-bd-compat-fixes:goproslowyo/local-bd-compat-fixes'
git switch 'goproslowyo/local-bd-compat-fixes'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'goproslowyo/local-bd-compat-fixes'
git switch 'goproslowyo/local-bd-compat-fixes'
git rebase 'main'
git switch 'main'
git merge --ff-only 'goproslowyo/local-bd-compat-fixes'
git switch 'goproslowyo/local-bd-compat-fixes'
git rebase 'main'
git switch 'main'
git merge --no-ff 'goproslowyo/local-bd-compat-fixes'
git switch 'main'
git merge --squash 'goproslowyo/local-bd-compat-fixes'
git switch 'main'
git merge --ff-only 'goproslowyo/local-bd-compat-fixes'
git switch 'main'
git merge 'goproslowyo/local-bd-compat-fixes'
git push origin 'main'
Sign in to join this conversation.
No description provided.