-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.html
42 lines (38 loc) · 1.1 KB
/
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Pocket Casts</title>
<style>
html,
body {
margin: 0;
padding: 0;
height: 100%;
}
#pocket {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div class="indicator"></div>
<webview id="pocket" src="http://play.pocketcasts.com/web" disablewebsecurity></webview>
<script>
const {ipcRenderer} = require('electron')
ipcRenderer.on('play-pause', (event, arg) => {
const webview = document.querySelector('webview')
webview.executeJavaScript("$('.play_pause_button')[0].click()");;
})
ipcRenderer.on('forward', (event, arg) => {
const webview = document.querySelector('webview')
webview.executeJavaScript("$('.skip_forward_button')[0].click()");;
})
ipcRenderer.on('backward', (event, arg) => {
const webview = document.querySelector('webview')
webview.executeJavaScript("$('.skip_back_button')[0].click()");;
})
</script>
</body>
</html>