update electron & remote module

This commit is contained in:
Araxeus
2021-12-13 20:10:36 +02:00
parent e1e9748002
commit 4fd683ed23
8 changed files with 64 additions and 36 deletions

View File

@ -1,7 +1,8 @@
const electron = require("electron");
//const remote = require('@electron/remote');
module.exports.getFolder = (customFolder) =>
customFolder || (electron.app || electron.remote.app).getPath("downloads");
customFolder || electron.app.getPath("downloads");
module.exports.defaultMenuDownloadLabel = "Download playlist";
const orderedQualityList = ["maxresdefault", "hqdefault", "mqdefault", "sdddefault"];

View File

@ -1,4 +1,6 @@
const { remote, ipcRenderer } = require("electron");
const { ipcRenderer } = require("electron");
const { Menu } = require("@electron/remote");
const customTitlebar = require("custom-electron-titlebar");
function $(selector) { return document.querySelector(selector); }
@ -12,7 +14,7 @@ module.exports = () => {
document.title = "Youtube Music";
ipcRenderer.on("updateMenu", function (_event, showMenu) {
bar.updateMenu(showMenu ? remote.Menu.getApplicationMenu() : null);
bar.updateMenu(showMenu ? Menu.getApplicationMenu() : null);
});
// Increases the right margin of Navbar background when the scrollbar is visible to avoid blocking it (z-index doesn't affect it)

View File

@ -1,4 +1,5 @@
const { ipcRenderer, remote } = require("electron");
const { ipcRenderer } = require("electron");
const { globalShortcut } = require('@electron/remote');
const { setOptions } = require("../../config/plugins");
@ -202,10 +203,10 @@ function setTooltip(volume) {
function setupGlobalShortcuts(options) {
if (options.globalShortcuts.volumeUp) {
remote.globalShortcut.register((options.globalShortcuts.volumeUp), () => changeVolume(true, options));
globalShortcut.register((options.globalShortcuts.volumeUp), () => changeVolume(true, options));
}
if (options.globalShortcuts.volumeDown) {
remote.globalShortcut.register((options.globalShortcuts.volumeDown), () => changeVolume(false, options));
globalShortcut.register((options.globalShortcuts.volumeDown), () => changeVolume(false, options));
}
}

View File

@ -1,5 +1,5 @@
const { ElementFromFile, templatePath } = require("../utils");
const dialog = require('electron').remote.dialog
const { dialog } = require('@electron/remote');
function $(selector) { return document.querySelector(selector); }