Skip to content

Commit 8141aec

Browse files
authored
Update 404 detection (#250)
1 parent 1891ab3 commit 8141aec

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ TEST: addTests('__urls_that_dont_match__', [
5757
'https://github.com/orgs/community/discussions/new/choose',
5858
]);
5959

60-
export const is404 = (): boolean => /^(Page|File) not found · GitHub/.test(document.title); // #98; When logged out, it starts with "File"
60+
export const is404 = (): boolean => /^(Page|File) not found(?: · GitHub|$)/.test(document.title);
6161

6262
export const is500 = (): boolean => document.title === 'Server Error · GitHub' || document.title === 'Unicorn! · GitHub' || document.title === '504 Gateway Time-out';
6363

0 commit comments

Comments
 (0)