diff --git a/src/main/Main.coffee b/src/main/Main.coffee index 101333950..a3ee5eece 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -406,11 +406,12 @@ Main = <%= html(' [report]') %> isThisPageLegit: -> - # 404 error page or similar. + # not 404 error page or similar. unless 'thisPageIsLegit' of Main - Main.thisPageIsLegit = location.hostname is 'boards.4chan.org' and - !$('link[href*="favicon-status.ico"]', d.head) and - d.title not in ['4chan - Temporarily Offline', '4chan - Error', '504 Gateway Time-out'] + Main.thisPageIsLegit = if Site.isThisPageLegit + Site.isThisPageLegit() + else + !/^[45]\d\d\b/.test(document.title) Main.thisPageIsLegit ready: (cb) -> diff --git a/src/site/SW.yotsuba.coffee b/src/site/SW.yotsuba.coffee index c1a6c6ae6..839bc44db 100644 --- a/src/site/SW.yotsuba.coffee +++ b/src/site/SW.yotsuba.coffee @@ -1 +1,6 @@ -SW.yotsuba = {} +SW.yotsuba = + isThisPageLegit: -> + # not 404 error page or similar. + location.hostname is 'boards.4chan.org' and + !$('link[href*="favicon-status.ico"]', d.head) and + d.title not in ['4chan - Temporarily Offline', '4chan - Error', '504 Gateway Time-out']