File tree 3 files changed +65
-2
lines changed
3 files changed +65
-2
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html >
3
+ < head >
4
+ < meta charset ="utf-8 " />
5
+ < title > Cannot load YouTube Music</ title >
6
+ < style >
7
+ body {
8
+ background : # 000 ;
9
+ }
10
+
11
+ .container {
12
+ margin : 0 ;
13
+ font-family : Roboto, Arial, sans-serif;
14
+ font-size : 20px ;
15
+ font-weight : 500 ;
16
+ color : rgba (255 , 255 , 255 , 0.5 );
17
+ position : absolute;
18
+ top : 50% ;
19
+ left : 50% ;
20
+ margin-right : -50% ;
21
+ transform : translate (-50% , -50% );
22
+ text-align : center;
23
+ }
24
+
25
+ .button {
26
+ background : # 065fd4 ;
27
+ overflow : hidden;
28
+ text-overflow : ellipsis;
29
+ white-space : nowrap;
30
+ color : white;
31
+ font : inherit;
32
+ text-transform : uppercase;
33
+ text-decoration : none;
34
+ border-radius : 2px ;
35
+ font-size : 16px ;
36
+ font-weight : normal;
37
+ text-align : center;
38
+ padding : 8px 22px ;
39
+ display : inline-block;
40
+ }
41
+ </ style >
42
+ </ head >
43
+
44
+ < body >
45
+ < div class ="container ">
46
+ < p > Cannot load YouTube Music… Internet disconnected?</ p >
47
+ < a href ="# " class ="button " onclick ="reload() "> Retry</ a >
48
+ </ div >
49
+ </ body >
50
+ </ html >
Original file line number Diff line number Diff line change @@ -72,6 +72,13 @@ function createMainWindow() {
72
72
} ) ;
73
73
} ) ;
74
74
75
+ win . webContents . on ( "did-fail-load" , ( ) => {
76
+ if ( isDev ) {
77
+ console . log ( "did fail load" ) ;
78
+ }
79
+ win . webContents . loadFile ( path . join ( __dirname , "error.html" ) ) ;
80
+ } ) ;
81
+
75
82
win . webContents . on ( "did-navigate-in-page" , ( ) => {
76
83
const url = win . webContents . getURL ( ) ;
77
84
if ( url . startsWith ( "https://music.youtube.com" ) ) {
Original file line number Diff line number Diff line change 1
1
const path = require ( "path" ) ;
2
2
3
- const { getEnabledPlugins } = require ( "./store" ) ;
4
- const { fileExists } = require ( "./plugins/utils" ) ;
3
+ const { getCurrentWindow } = require ( "electron" ) . remote ;
4
+
5
+ const { getEnabledPlugins, store } = require ( "./store" ) ;
6
+ const { fileExists } = require ( "./plugins/utils" ) ;
5
7
6
8
const plugins = getEnabledPlugins ( ) ;
7
9
@@ -23,4 +25,8 @@ document.addEventListener("DOMContentLoaded", () => {
23
25
run ( ) ;
24
26
} ) ;
25
27
} ) ;
28
+
29
+ // Add action for reloading
30
+ global . reload = ( ) =>
31
+ getCurrentWindow ( ) . webContents . loadURL ( store . get ( "url" ) ) ;
26
32
} ) ;
You can’t perform that action at this time.
0 commit comments