Skip to content

Mooshieblob1/copy-webp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CopyImagePNG

A Vencord userplugin that adds a Copy Image (PNG) option to Discord's right-click menus, including for WebP and AVIF images, which Discord refuses to copy.

Works in Vesktop, the official Discord desktop app (with Vencord injected), and browser Discord (with the Vencord extension).

Why

Discord's canCopyImage check only allows copying jpg / jpeg / jfif / png. Anything else silently loses the "Copy Image" menu item, most notably WebP, the format Discord re-encodes most uploads into. "Save Image" has a separate, wider allowlist, which is why saving still works. Even Vencord's built-in WebContextMenus plugin only bypasses the platform checks, not the format allowlist, so the item stays missing for WebP.

This plugin sidesteps all of that: it adds its own menu item via Vencord's ContextMenu API, fetches the image, re-encodes it to PNG on a canvas, and writes it to the clipboard (via Vesktop's native clipboard bridge when available, the web Clipboard API otherwise).

Installation

Custom plugins require building Vencord from source (official guide):

git clone https://github.com/Vendicated/Vencord
cd Vencord
pnpm install --frozen-lockfile
git clone https://github.com/Mooshieblob1/copy-webp src/userplugins/copy-webp
pnpm build

Don't symlink/junction the folder in. esbuild resolves links to their real path, which lands outside Vencord's tsconfig.json coverage and breaks the @api/... import aliases. Clone (or copy the files) into src/userplugins/copy-webp and git pull / re-copy to update.

Vesktop

  1. Create an empty package.json in the dist folder first (just {}):

    Set-Content Vencord\dist\package.json '{}'

    Without it, Vesktop considers the folder an incomplete Vencord install and silently overwrites the vencordDesktop* files with the official release on launch, wiping your plugin.

  2. Open Vesktop → SettingsVesktop Settings → scroll to Developer OptionsOpen Developer SettingsVencord Location

  3. Select the dist folder inside your Vencord clone

  4. Fully restart Vesktop (quit from the tray, not just reload)

  5. Enable CopyImagePNG under Vencord settings → Plugins

Official Discord desktop

Run pnpm inject from the Vencord clone and pick your Discord installation. The plugin is included in the build.

Updating / iterating

After any plugin or Vencord update: pnpm build, then fully restart the client. There is no hot reload.

Notes

  • Animated WebP/GIF copies as a still of the first frame, since clipboards only hold static bitmaps.
  • On Vesktop, the clipboard also receives an HTML <img> fallback (courtesy of Vesktop's native clipboard bridge), so HTML-aware paste targets get the original URL.

About

Vencord userplugin: adds Copy Image (PNG) to Discord's right-click menus for WebP/AVIF images Discord refuses to copy

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors