diff --git a/scripts/reading/context-menu.js b/scripts/reading/context-menu.js old mode 100755 new mode 100644 index 1ed96a81a..0f29b7327 --- a/scripts/reading/context-menu.js +++ b/scripts/reading/context-menu.js @@ -542,9 +542,12 @@ async function copyImageToClipboard() URL.revokeObjectURL(data.blob); } - const nativeImage = electron.nativeImage.createFromDataURL(canvas.toDataURL()); + // Electron 44 removed the clipboard module from the renderer, use the web Clipboard API instead + const blob = await new Promise(function(resolve) { + canvas.toBlob(resolve, 'image/png'); + }); - electron.clipboard.writeImage(nativeImage, 'clipboard'); + await navigator.clipboard.write([new ClipboardItem({'image/png': blob})]); events.snackbar({ key: 'copyImageToClipboard',