Repository navigation
Expand file tree
/
Copy pathpreload.js
More file actions
54 lines (54 loc) · 1.46 KB
/
Copy pathpreload.js
File metadata and controls
54 lines (54 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//const { contextBridge, webFrame, ipcRenderer } = require('electron')
//contextBridge.exposeInMainWorld('electronAPI',{
//// sync: (rpc) => {
//// return ipcRenderer.invoke('sync', rpc)
//// },
//// del: (filenames) => {
//// if (Array.isArray(filenames)) {
//// return ipcRenderer.invoke("del", filenames)
//// } else {
//// return ipcRenderer.invoke("del", [filenames])
//// }
//// },
// startDrag: (fileNames) => {
// ipcRenderer.send('ondragstart', fileNames)
// },
//// onMsg: (callback) => ipcRenderer.on('msg', callback),
//// select: () => {
//// return ipcRenderer.invoke("select")
//// },
//// copy: (text) => {
//// return ipcRenderer.invoke("copy", text)
//// },
//// defaults: () => {
//// return ipcRenderer.invoke("defaults")
//// },
//// gm: (rpc) => {
//// return ipcRenderer.invoke("gm", rpc)
//// },
//// open: (file_path) => {
//// return ipcRenderer.invoke("open", file_path)
//// },
//// xmp: (file_path) => {
//// return ipcRenderer.invoke("xmp", file_path)
//// },
// zoom: (ratio) => {
// // ratio 50 - 200
// if (ratio >= 50 && ratio <= 200) {
// webFrame.setZoomFactor(ratio/100)
// }
// },
// getzoom: () => {
// // ratio 50 - 200
// return webFrame.getZoomFactor()
// },
//// docs: () => {
//// ipcRenderer.invoke("docs")
//// },
//// theme: (val) => {
//// ipcRenderer.invoke("theme", val)
//// },
//// debug: () => {
//// ipcRenderer.invoke("debug")
//// }
//})