forked from securingsincity/pocket-casts-electron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
43 lines (36 loc) · 964 Bytes
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Pocket Casts</title>
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
webview {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="indicator"></div>
<webview src="https://playbeta.pocketcasts.com/web/" disablewebsecurity></webview>
<script>
const {ipcRenderer} = require('electron')
const webview = document.querySelector('webview')
ipcRenderer.on('play-pause', (event, arg) => {
webview.executeJavaScript("document.querySelector('.play_pause_button').click()")
})
ipcRenderer.on('forward', (event, arg) => {
webview.executeJavaScript("document.querySelector('.skip_forward_button').click()");
})
ipcRenderer.on('backward', (event, arg) => {
webview.executeJavaScript("document.querySelector('.skip_back_button').click()");
})
</script>
</body>
</html>