-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
48 lines (40 loc) · 1.26 KB
/
index.js
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
const { app, BrowserWindow } = require('electron');
class App {
#_app = app;
#_BASEURL = 'https://app.playeternalreturn.com:5000/main/indexlog';
constructor() {
this.#_app.disableHardwareAcceleration();
this.#start();
}
#createWindow() {
return new BrowserWindow({
title: "ER LAB",
width: 430,
height: 932,
resizable: false,
center: true,
autoHideMenuBar: true,
icon: './assets/icon.ico',
titleBarStyle: 'hiddenInset',
backgroundColor: '#17171b',
})
}
#finishLoad(window) {
window.loadURL(this.#_BASEURL);
window.webContents.on('did-finish-load', async () => await this.#removeElements(window));
}
async #removeElements(window) {
await window.webContents.executeJavaScript(`
document.title = 'ER LAB';
for(const e of ['pop_wrap', 'dimmed']) {
document.querySelectorAll('.'.concat(e))
.forEach(r => r.remove())
}
`)
}
#start() {
this.#_app.whenReady().then(() => this.#finishLoad(this.#createWindow()))
this.#_app.on('window-all-closed', () => this.#_app.quit())
}
}
new App()