1
0
Fork 1
mirror of https://github.com/Vendicated/Vencord.git synced 2025-01-10 18:06:22 +00:00

WebContextMenus: use vesktop native clipboard - fixes some permission issues

This commit is contained in:
Vendicated 2024-01-13 19:05:01 +01:00 committed by Luna
parent 8ea6765192
commit 2df20de9b0

View file

@ -182,6 +182,12 @@ export default definePlugin({
],
async copyImage(url: string) {
if (IS_VESKTOP && VesktopNative.clipboard) {
const data = await fetch(url).then(r => r.arrayBuffer());
VesktopNative.clipboard.copyImage(data, url);
return;
}
// Clipboard only supports image/png, jpeg and similar won't work. Thus, we need to convert it to png
// via canvas first
const img = new Image();