WebContextMenus: use vesktop native clipboard - fixes some permission issues
This commit is contained in:
parent
8c89002867
commit
cb7045c00b
1 changed files with 6 additions and 0 deletions
|
@ -182,6 +182,12 @@ export default definePlugin({
|
||||||
],
|
],
|
||||||
|
|
||||||
async copyImage(url: string) {
|
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
|
// Clipboard only supports image/png, jpeg and similar won't work. Thus, we need to convert it to png
|
||||||
// via canvas first
|
// via canvas first
|
||||||
const img = new Image();
|
const img = new Image();
|
||||||
|
|
Loading…
Reference in a new issue