mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 18:41:47 +00:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| eac2c5cf14 | |||
| 5a1d7fbf23 |
50
error.html
Normal file
50
error.html
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8" />
|
||||||
|
<title>Cannot load YouTube Music</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background: #000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
margin: 0;
|
||||||
|
font-family: Roboto, Arial, sans-serif;
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
color: rgba(255, 255, 255, 0.5);
|
||||||
|
position: absolute;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
margin-right: -50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button {
|
||||||
|
background: #065fd4;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
color: white;
|
||||||
|
font: inherit;
|
||||||
|
text-transform: uppercase;
|
||||||
|
text-decoration: none;
|
||||||
|
border-radius: 2px;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: normal;
|
||||||
|
text-align: center;
|
||||||
|
padding: 8px 22px;
|
||||||
|
display: inline-block;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<p>Cannot load YouTube Music… Internet disconnected?</p>
|
||||||
|
<a href="#" class="button" onclick="reload()">Retry</a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
7
index.js
7
index.js
@ -72,6 +72,13 @@ function createMainWindow() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
win.webContents.on("did-fail-load", () => {
|
||||||
|
if (isDev) {
|
||||||
|
console.log("did fail load");
|
||||||
|
}
|
||||||
|
win.webContents.loadFile(path.join(__dirname, "error.html"));
|
||||||
|
});
|
||||||
|
|
||||||
win.webContents.on("did-navigate-in-page", () => {
|
win.webContents.on("did-navigate-in-page", () => {
|
||||||
const url = win.webContents.getURL();
|
const url = win.webContents.getURL();
|
||||||
if (url.startsWith("https://music.youtube.com")) {
|
if (url.startsWith("https://music.youtube.com")) {
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "youtube-music",
|
"name": "youtube-music",
|
||||||
"version": "1.1.1",
|
"version": "1.1.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name" : "youtube-music",
|
"name" : "youtube-music",
|
||||||
"productName": "YouTube Music",
|
"productName": "YouTube Music",
|
||||||
"version" : "1.1.1",
|
"version" : "1.1.2",
|
||||||
"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",
|
||||||
|
|||||||
10
preload.js
10
preload.js
@ -1,7 +1,9 @@
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
|
|
||||||
const { getEnabledPlugins } = require("./store");
|
const { getCurrentWindow } = require("electron").remote;
|
||||||
const { fileExists } = require("./plugins/utils");
|
|
||||||
|
const { getEnabledPlugins, store } = require("./store");
|
||||||
|
const { fileExists } = require("./plugins/utils");
|
||||||
|
|
||||||
const plugins = getEnabledPlugins();
|
const plugins = getEnabledPlugins();
|
||||||
|
|
||||||
@ -23,4 +25,8 @@ document.addEventListener("DOMContentLoaded", () => {
|
|||||||
run();
|
run();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add action for reloading
|
||||||
|
global.reload = () =>
|
||||||
|
getCurrentWindow().webContents.loadURL(store.get("url"));
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user