mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 37cac19d9c | |||
| 4824dda5d5 | |||
| 3fa3c3ab9e | |||
| 058371ace8 | |||
| 430687f4d6 | |||
| 45f4b3bc28 | |||
| 7c12344d05 | |||
| 98213005d0 | |||
| db61589735 |
15
index.js
15
index.js
@ -10,6 +10,7 @@ const {
|
|||||||
autoUpdate,
|
autoUpdate,
|
||||||
getEnabledPlugins,
|
getEnabledPlugins,
|
||||||
isAppVisible,
|
isAppVisible,
|
||||||
|
isTrayEnabled,
|
||||||
store,
|
store,
|
||||||
} = require("./store");
|
} = require("./store");
|
||||||
const { fileExists, injectCSS } = require("./plugins/utils");
|
const { fileExists, injectCSS } = require("./plugins/utils");
|
||||||
@ -183,16 +184,20 @@ app.on("ready", () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Optimized for Mac OS X
|
// Optimized for Mac OS X
|
||||||
if (process.platform === "darwin") {
|
if (is.macOS()) {
|
||||||
if (!isAppVisible()) {
|
if (!isAppVisible()) {
|
||||||
app.dock.hide();
|
app.dock.hide();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var forceQuit = false;
|
var forceQuit = false;
|
||||||
app.on("before-quit", () => {
|
app.on("before-quit", () => {
|
||||||
forceQuit = true;
|
forceQuit = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (is.macOS() || isTrayEnabled()) {
|
||||||
mainWindow.on("close", (event) => {
|
mainWindow.on("close", (event) => {
|
||||||
|
// Hide the window instead of quitting (quit is available in tray options)
|
||||||
if (!forceQuit) {
|
if (!forceQuit) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
mainWindow.hide();
|
mainWindow.hide();
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "youtube-music",
|
"name": "youtube-music",
|
||||||
"productName": "YouTube Music",
|
"productName": "YouTube Music",
|
||||||
"version": "1.3.1",
|
"version": "1.3.3",
|
||||||
"description": "YouTube Music Desktop App - including custom plugins",
|
"description": "YouTube Music Desktop App - including custom plugins",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": "th-ch/youtube-music",
|
"repository": "th-ch/youtube-music",
|
||||||
@ -52,7 +52,7 @@
|
|||||||
"electron-is": "^3.0.0",
|
"electron-is": "^3.0.0",
|
||||||
"electron-localshortcut": "^3.2.1",
|
"electron-localshortcut": "^3.2.1",
|
||||||
"electron-store": "^5.1.1",
|
"electron-store": "^5.1.1",
|
||||||
"electron-updater": "^4.2.2",
|
"electron-updater": "^4.3.0",
|
||||||
"node-fetch": "^2.6.0"
|
"node-fetch": "^2.6.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
4
tray.js
4
tray.js
@ -22,6 +22,10 @@ module.exports.setUpTray = (app, win) => {
|
|||||||
});
|
});
|
||||||
tray = new Tray(trayIcon);
|
tray = new Tray(trayIcon);
|
||||||
tray.setToolTip("Youtube Music");
|
tray.setToolTip("Youtube Music");
|
||||||
|
tray.setIgnoreDoubleClickEvents(true);
|
||||||
|
tray.on("click", () => {
|
||||||
|
win.isVisible() ? win.hide() : win.show();
|
||||||
|
});
|
||||||
|
|
||||||
const trayMenu = Menu.buildFromTemplate([
|
const trayMenu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
|
|||||||
23
yarn.lock
23
yarn.lock
@ -777,6 +777,14 @@ buffer@^4.3.0:
|
|||||||
ieee754 "^1.1.4"
|
ieee754 "^1.1.4"
|
||||||
isarray "^1.0.0"
|
isarray "^1.0.0"
|
||||||
|
|
||||||
|
builder-util-runtime@8.6.1:
|
||||||
|
version "8.6.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.6.1.tgz#cf9a268fa51704de24f3c085aa8d1d1b3767d9ea"
|
||||||
|
integrity sha512-gwIUtMaICmc+e2EC3u3byXcwCyfhtG40LJRNnGfs8AYqacKl4ZLP50ab+uDttn7QAXe0LfMAuKz9v8bCODV0yg==
|
||||||
|
dependencies:
|
||||||
|
debug "^4.1.1"
|
||||||
|
sax "^1.2.4"
|
||||||
|
|
||||||
builder-util-runtime@8.6.2:
|
builder-util-runtime@8.6.2:
|
||||||
version "8.6.2"
|
version "8.6.2"
|
||||||
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.6.2.tgz#8270e15b012d8d3b110f3e327b0fd8b0e07b1686"
|
resolved "https://registry.yarnpkg.com/builder-util-runtime/-/builder-util-runtime-8.6.2.tgz#8270e15b012d8d3b110f3e327b0fd8b0e07b1686"
|
||||||
@ -1574,18 +1582,17 @@ electron-store@^5.1.1:
|
|||||||
conf "^6.2.1"
|
conf "^6.2.1"
|
||||||
type-fest "^0.7.1"
|
type-fest "^0.7.1"
|
||||||
|
|
||||||
electron-updater@^4.2.2:
|
electron-updater@^4.3.0:
|
||||||
version "4.2.5"
|
version "4.3.0"
|
||||||
resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-4.2.5.tgz#dbced8da6f8c6fc2dc662f2776131f5a49ce018d"
|
resolved "https://registry.yarnpkg.com/electron-updater/-/electron-updater-4.3.0.tgz#f66c253b25431d9aeb04fbd33c79062f33943d44"
|
||||||
integrity sha512-ir8SI3capF5pN4LTQY79bP7oqiBKjgtdDW378xVId5VcGUZ+Toei2j+fgx1mq3y4Qg19z4HqLxEZ9FqMD0T0RA==
|
integrity sha512-5K3vPgeiBGQaaCcZzQP00QYhGsh0l/q0mwzGWVZq1BHJ5akA+BpsY+EPiI9JzBhNVIdNlUvSKr5azUdbMwZeig==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/semver" "^7.1.0"
|
"@types/semver" "^7.1.0"
|
||||||
builder-util-runtime "8.6.2"
|
builder-util-runtime "8.6.1"
|
||||||
fs-extra "^8.1.0"
|
fs-extra "^9.0.0"
|
||||||
js-yaml "^3.13.1"
|
js-yaml "^3.13.1"
|
||||||
lazy-val "^1.0.4"
|
lazy-val "^1.0.4"
|
||||||
lodash.isequal "^4.5.0"
|
lodash.isequal "^4.5.0"
|
||||||
pako "^1.0.11"
|
|
||||||
semver "^7.1.3"
|
semver "^7.1.3"
|
||||||
|
|
||||||
electron@^8.2.1:
|
electron@^8.2.1:
|
||||||
@ -4048,7 +4055,7 @@ package-json@^6.3.0:
|
|||||||
registry-url "^5.0.0"
|
registry-url "^5.0.0"
|
||||||
semver "^6.2.0"
|
semver "^6.2.0"
|
||||||
|
|
||||||
pako@^1.0.11, pako@~1.0.2, pako@~1.0.5:
|
pako@~1.0.2, pako@~1.0.5:
|
||||||
version "1.0.11"
|
version "1.0.11"
|
||||||
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf"
|
resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf"
|
||||||
integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==
|
integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==
|
||||||
|
|||||||
Reference in New Issue
Block a user