-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreload.js
32 lines (25 loc) · 871 Bytes
/
preload.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
const {ipcRenderer} = require('electron');
const CHANNEL_NAME = 'main';
const CHANNEL_NAME2 = 'deblock';
document.addEventListener('DOMContentLoaded', function () {
let myButton = document.getElementById("myButton");
myButton.addEventListener('click', ()=> {
let txtBox = document.getElementById('site');
let txtVal = txtBox.value;
if (txtVal != "") {
ipcRenderer.send(CHANNEL_NAME, txtVal); // send request
}
document.getElementById('site').value="";
})
})
document.addEventListener('DOMContentLoaded', function () {
let btn = document.getElementById("deblock");
btn.addEventListener('click', ()=> {
let txtBox2 = document.getElementById('sitetounlock');
let txtVal1 = txtBox2.value;
if (txtVal1 != "") {
ipcRenderer.send(CHANNEL_NAME2, txtVal1); // send request
}
document.getElementById('sitetounlock').value="";
})
})