-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
48 lines (41 loc) · 998 Bytes
/
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')
app.setAppUserModelId("Rule34 Browser")
app.disableHardwareAcceleration()
function createWindow () {
const win = new BrowserWindow({
icon: __dirname+'/Image/favicon.ico',
minWidth: 800,
minHeight: 600,
width: 800,
height: 600,
frame: false,
center: true,
show: false,
backgroundColor: "#fff",
paintWhenInitiallyHidden: true,
title: 'Rule34 Browser v2.3.6',
webPreferences: {
enableRemoteModule: true,
nodeIntegration: true,
contextIsolation: false
}
})
win.maximize(true)
win.setMenu(null)
win.addListener('close', e => {e.preventDefault()})
win.loadFile(require('path').join(__dirname, 'index.html'))
win.once('ready-to-show', () => {
win.show()
})
}
app.whenReady().then(() => {
createWindow()
app.on('activate', function () {
if (BrowserWindow.getAllWindows().length === 0) createWindow()
})
})
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit()
}
})