Files
kopia/app/public/preload.js
T
Jarek Kowalski 09575943f8 test(ui): added minimal automated KopiaUI test (#2434)
* test(ui): added minimal automated KopiaUI test

```
$ make kopia-ui-test
```

This currently executes super minimal E2E test on pre-built KopiaUI
using Playwright https://playwright.dev

* better os/arch detection

* remove unwanted log

* fixed executable path on linux

* fix for linux, misc
2022-09-23 17:37:36 -07:00

14 lines
340 B
JavaScript

const { contextBridge, shell, ipcRenderer } = require("electron");
contextBridge.exposeInMainWorld("kopiaUI", {
"selectDirectory": function (onSelected) {
ipcRenderer.invoke('select-dir').then(v => {
onSelected(v);
});
},
"browseDirectory": function(path) {
shell.openPath(path);
},
})