File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ addTests('__urls_that_dont_match__', [
12
12
'https://github.com/sindresorhus/refined-github/issues/templates/edit' ,
13
13
] ) ;
14
14
15
- export const is404 = ( ) : boolean => document . title . startsWith ( ' Page not found · GitHub' ) ; // #98
15
+ export const is404 = ( ) : boolean => / ^ ( P a g e | F i l e ) n o t f o u n d · G i t H u b / . test ( document . title ) ; // #98; When logged out, it starts with "File"
16
16
17
17
export const is500 = ( ) : boolean => document . title === 'Server Error · GitHub' || document . title === 'Unicorn! · GitHub' || document . title === '504 Gateway Time-out' ;
18
18
Original file line number Diff line number Diff line change @@ -72,6 +72,9 @@ test('is404', t => {
72
72
document . title = 'Page not found · GitHub' ;
73
73
t . true ( pageDetect . is404 ( ) ) ;
74
74
75
+ document . title = 'File not found · GitHub' ;
76
+ t . true ( pageDetect . is404 ( ) ) ;
77
+
75
78
document . title = 'examples/404: Page not found examples' ;
76
79
t . false ( pageDetect . is404 ( ) ) ;
77
80
You can’t perform that action at this time.
0 commit comments