-
Notifications
You must be signed in to change notification settings - Fork 119
/
index.js
63 lines (36 loc) · 1.33 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
var app = require('electron').app
const session = require('electron').session;
const { BrowserWindow } = require('electron');
const { ipcRenderer } = require('electron')
var remote = require('electron').remote
var mainWindow = null
app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit()
}
})
app.on('ready', function () {
const filter = {
urls: []
}
session.defaultSession.webRequest.onBeforeSendHeaders(filter, (details, callback) => {
if(details.method==='POST' && !(details.url.includes('#shetajyanmx')) && (details.webContentsId==2 || details.webContentsId==null) && details.requestHeaders["Content-Type"]=='application/x-www-form-urlencoded'){
mainWindow.webContents.send('my-ipc-channel', details);
};
callback({ requestHeaders: details.requestHeaders })
})
const path = require('path');
process.env['ELECTRON_DISABLE_SECURITY_WARNINGS'] = true;
mainWindow = new BrowserWindow({ width: 1030, height: 720,icon: __dirname+'/build/1.ico', frame: false,
webPreferences: {
enableRemoteModule: true,
nodeIntegration : true,
webviewTag : true,
contextIsolation: false
}
})
mainWindow.loadURL('file://' + require('path').join(__dirname, 'browser.html'))
mainWindow.on('closed', function() {
mainWindow = null
})
})