mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 10:31:47 +00:00
Merge branch 'master' into patch-1
This commit is contained in:
11
index.js
11
index.js
@ -317,17 +317,6 @@ app.once("browser-window-created", (event, win) => {
|
|||||||
win.webContents.on("will-prevent-unload", (event) => {
|
win.webContents.on("will-prevent-unload", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
});
|
});
|
||||||
|
|
||||||
win.webContents.on(
|
|
||||||
"new-window",
|
|
||||||
(e, url, frameName, disposition, options) => {
|
|
||||||
// hook on new opened window
|
|
||||||
|
|
||||||
// at now new window in mainWindow renderer process.
|
|
||||||
// Also, this will automatically get an option `nodeIntegration=false`(not override to true, like in iframe's) - like in regular browsers
|
|
||||||
options.webPreferences.affinity = "main-window";
|
|
||||||
}
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
app.on("window-all-closed", () => {
|
app.on("window-all-closed", () => {
|
||||||
|
|||||||
9
menu.js
9
menu.js
@ -1,7 +1,7 @@
|
|||||||
const { existsSync } = require("fs");
|
const { existsSync } = require("fs");
|
||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
const { app, Menu, dialog } = require("electron");
|
const { app, clipboard, Menu, dialog } = require("electron");
|
||||||
const is = require("electron-is");
|
const is = require("electron-is");
|
||||||
const { restart } = require("./providers/app-controls");
|
const { restart } = require("./providers/app-controls");
|
||||||
|
|
||||||
@ -329,6 +329,13 @@ const mainMenuTemplate = (win) => {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: "Copy current URL",
|
||||||
|
click: () => {
|
||||||
|
const currentURL = win.webContents.getURL();
|
||||||
|
clipboard.writeText(currentURL);
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: "Restart App",
|
label: "Restart App",
|
||||||
click: restart
|
click: restart
|
||||||
|
|||||||
@ -82,8 +82,9 @@
|
|||||||
"build:win": "yarn run clean && electron-builder --win",
|
"build:win": "yarn run clean && electron-builder --win",
|
||||||
"lint": "xo",
|
"lint": "xo",
|
||||||
"changelog": "auto-changelog",
|
"changelog": "auto-changelog",
|
||||||
"plugins": "yarn run plugin:adblocker",
|
"plugins": "yarn run plugin:adblocker && yarn run plugin:bypass-age-restrictions",
|
||||||
"plugin:adblocker": "del-cli -f \"plugins/adblocker/ad-blocker-engine.bin\" && node plugins/adblocker/blocker.js",
|
"plugin:adblocker": "del-cli -f \"plugins/adblocker/ad-blocker-engine.bin\" && node plugins/adblocker/blocker.js",
|
||||||
|
"plugin:bypass-age-restrictions": "yarn run generate:package Simple-YouTube-Age-Restriction-Bypass",
|
||||||
"release:linux": "yarn run clean && electron-builder --linux -p always -c.snap.publish=github",
|
"release:linux": "yarn run clean && electron-builder --linux -p always -c.snap.publish=github",
|
||||||
"release:mac": "yarn run clean && electron-builder --mac -p always",
|
"release:mac": "yarn run clean && electron-builder --mac -p always",
|
||||||
"release:win": "yarn run clean && electron-builder --win -p always"
|
"release:win": "yarn run clean && electron-builder --win -p always"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
module.exports = () => {
|
module.exports = () => {
|
||||||
// See https://github.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass#userscript
|
// See https://github.com/zerodytrash/Simple-YouTube-Age-Restriction-Bypass#userscript
|
||||||
require("simple-youtube-age-restriction-bypass/Simple-YouTube-Age-Restriction-Bypass.user.js");
|
require("Simple-YouTube-Age-Restriction-Bypass/Simple-YouTube-Age-Restriction-Bypass.user.js");
|
||||||
};
|
};
|
||||||
|
|||||||
@ -10,7 +10,15 @@ const { promisify } = require("util");
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const generatePackageJson = async packageName => {
|
const generatePackageJson = async packageName => {
|
||||||
var filepath = join("node_modules", packageName, "package.json");
|
const packageFolder = join("node_modules", packageName)
|
||||||
|
if (!existsSync(packageFolder )) {
|
||||||
|
console.log(
|
||||||
|
`${packageName} module not found, exiting…`
|
||||||
|
);
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const filepath = join(packageFolder, "package.json");
|
||||||
if (!existsSync(filepath)) {
|
if (!existsSync(filepath)) {
|
||||||
console.log(
|
console.log(
|
||||||
`No package.json found for ${packageName} module, generating one…`
|
`No package.json found for ${packageName} module, generating one…`
|
||||||
|
|||||||
Reference in New Issue
Block a user