-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtrayWindow.html
More file actions
29 lines (27 loc) · 914 Bytes
/
trayWindow.html
File metadata and controls
29 lines (27 loc) · 914 Bytes
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
</head>
<body>
<h1>Show Notifications and alerts here!</h1>
<button id="close">CLOSE TRAY WINDOW</button>
<button id="open">CLOSE AND OPEN MAIN WINDOW</button>
<script>
const electron = require("electron");
const { ipcRenderer, remote } = electron;
document.getElementById("close").addEventListener("click", function(e) {
var window = remote.getCurrentWindow();
window.close();
});
document.getElementById("open").addEventListener("click", function(e) {
var window = remote.getCurrentWindow();
window.close();
ipcRenderer.send("tray:open", 1);
});
</script>
</body>
</html>