forked from securingsincity/pocket-casts-electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
288d3a5
commit 2764488
Showing
8 changed files
with
96 additions
and
37 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
<!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="https://playbeta.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()");; | ||
}) | ||
<head> | ||
<meta charset="UTF-8"> | ||
<title>Pocket Casts</title> | ||
<style> | ||
html, | ||
body { | ||
margin: 0; | ||
padding: 0; | ||
height: 100%; | ||
} | ||
|
||
ipcRenderer.on('forward', (event, arg) => { | ||
const webview = document.querySelector('webview') | ||
webview.executeJavaScript("$('.skip_forward_button')[0].click()");; | ||
}) | ||
webview { | ||
width: 100%; | ||
height: 100%; | ||
} | ||
</style> | ||
</head> | ||
|
||
ipcRenderer.on('backward', (event, arg) => { | ||
const webview = document.querySelector('webview') | ||
webview.executeJavaScript("$('.skip_back_button')[0].click()");; | ||
}) | ||
<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> | ||
|
||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
const path = require("path"); | ||
|
||
module.exports = function(win) { | ||
let pauseButtons = [ | ||
{ | ||
tooltip: "Skip Back", | ||
icon: path.join(__dirname, "icons", "skipback.png"), | ||
click() { | ||
win.webContents.send("backward"); | ||
} | ||
}, | ||
{ | ||
tooltip: "Pause", | ||
icon: path.join(__dirname, "icons", "pause.png"), | ||
click() { | ||
win.setThumbarButtons(playButtons); | ||
win.webContents.send("play-pause"); | ||
} | ||
}, | ||
{ | ||
tooltip: "Skip Forward", | ||
icon: path.join(__dirname, "icons", "skipforward.png"), | ||
click() { | ||
win.webContents.send("forward"); | ||
} | ||
} | ||
]; | ||
|
||
let playButtons = [ | ||
{ | ||
tooltip: "Skip Back", | ||
icon: path.join(__dirname, "icons", "skipback.png"), | ||
click() { | ||
win.webContents.send("backward"); | ||
} | ||
}, | ||
{ | ||
tooltip: "Play", | ||
icon: path.join(__dirname, "icons", "play.png"), | ||
click() { | ||
win.setThumbarButtons(pauseButtons); | ||
win.webContents.send("play-pause"); | ||
} | ||
}, | ||
{ | ||
tooltip: "Skip Forward", | ||
icon: path.join(__dirname, "icons", "skipforward.png"), | ||
click() { | ||
win.webContents.send("forward"); | ||
} | ||
} | ||
]; | ||
|
||
return playButtons; | ||
}; | ||
|