mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +00:00
Initial commit - app + 4 plugins
This commit is contained in:
23
plugins/navigation/back.js
Normal file
23
plugins/navigation/back.js
Normal file
@ -0,0 +1,23 @@
|
||||
const { listenAction } = require("../utils");
|
||||
const { ACTIONS, CHANNEL } = require("./actions.js");
|
||||
|
||||
function handle(win) {
|
||||
listenAction(CHANNEL, (event, action) => {
|
||||
switch (action) {
|
||||
case ACTIONS.NEXT:
|
||||
if (win.webContents.canGoForward()) {
|
||||
win.webContents.goForward();
|
||||
}
|
||||
break;
|
||||
case ACTIONS.BACK:
|
||||
if (win.webContents.canGoBack()) {
|
||||
win.webContents.goBack();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
console.log("Unknown action: " + action);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = handle;
|
||||
Reference in New Issue
Block a user