-
-
Notifications
You must be signed in to change notification settings - Fork 53
Expand file tree
/
Copy pathexample.js
More file actions
17 lines (14 loc) · 620 Bytes
/
Copy pathexample.js
File metadata and controls
17 lines (14 loc) · 620 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import {app, BrowserWindow} from 'electron';
import debug from './index.js';
debug();
const load = async url => {
const window_ = new BrowserWindow({show: true});
await window_.loadURL(url);
window_.removeMenu();
};
// Top-level `await` cannot be used here. Electron does not make the app ready until the main module has finished evaluating, so awaiting `app.whenReady()` at the top level deadlocks. `unicorn/prefer-top-level-await` is off in the XO config for this reason.
(async () => {
await app.whenReady();
await load(new URL('fixture.html', import.meta.url).href);
await load('https://google.com');
})();