|
@@ -18,6 +18,20 @@ function getFilePathFromClipboard () {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Read the contents of the clipboard for a custom format.
|
|
|
+ * @param {string} format The custom format to read.
|
|
|
+ * @returns Buffer containing the contents of the clipboard for the specified format, or null if not available.
|
|
|
+ */
|
|
|
+function getClipboardData (format) {
|
|
|
+ if (clipboard.has(mime, "clipboard")) {
|
|
|
+ return clipboard.readBuffer(mime)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
contextBridge.exposeInMainWorld('apis', {
|
|
|
doAction: async (arg) => {
|
|
|
return await ipcRenderer.invoke('main', arg)
|
|
@@ -172,6 +186,8 @@ contextBridge.exposeInMainWorld('apis', {
|
|
|
|
|
|
getFilePathFromClipboard,
|
|
|
|
|
|
+ getClipboardData,
|
|
|
+
|
|
|
setZoomFactor (factor) {
|
|
|
webFrame.setZoomFactor(factor)
|
|
|
},
|