mirror of
https://github.com/kopia/kopia.git
synced 2026-01-26 23:38:04 -05:00
16 lines
393 B
JavaScript
16 lines
393 B
JavaScript
const { contextBridge, shell, ipcRenderer } = require("electron");
|
|
|
|
console.log('preloading...', contextBridge, shell);
|
|
|
|
contextBridge.exposeInMainWorld("kopiaUI", {
|
|
"selectDirectory": function (onSelected) {
|
|
ipcRenderer.invoke('select-dir').then(v => {
|
|
onSelected(v);
|
|
});
|
|
},
|
|
"browseDirectory": function(path) {
|
|
shell.openPath(path);
|
|
},
|
|
})
|
|
|