From 191dc4911ff3fa799c68edf6b13001e735ce171f Mon Sep 17 00:00:00 2001 From: Zixaphir Date: Thu, 8 Aug 2013 20:25:36 -0700 Subject: [PATCH] Initial attempt at implementing 404 redirection when 4chan is down http://github.com/zixaphir/appchan-x/issues/394 --- builds/4chan-X.user.js | 2 +- builds/crx/script.js | 2 +- src/General/Main.coffee | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/builds/4chan-X.user.js b/builds/4chan-X.user.js index 938550122..f3cf1cc86 100644 --- a/builds/4chan-X.user.js +++ b/builds/4chan-X.user.js @@ -10314,7 +10314,7 @@ $.ready(function() { var URL; - if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') { + if (Conf['404 Redirect'] && ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) { Redirect.init(); pathname = location.pathname.split('/'); URL = Redirect.to('file', { diff --git a/builds/crx/script.js b/builds/crx/script.js index d0bb4551b..f5a43b9e2 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -10298,7 +10298,7 @@ $.ready(function() { var URL; - if (Conf['404 Redirect'] && d.title === '4chan - 404 Not Found') { + if (Conf['404 Redirect'] && ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains(d.title)) { Redirect.init(); pathname = location.pathname.split('/'); URL = Redirect.to('file', { diff --git a/src/General/Main.coffee b/src/General/Main.coffee index aeedede7d..e4deba2bc 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -48,7 +48,7 @@ Main = return when 'images.4chan.org' $.ready -> - if Conf['404 Redirect'] and d.title is '4chan - 404 Not Found' + if Conf['404 Redirect'] and ['4chan - Temporarily Offline', '4chan - 404 Not Found'].contains d.title Redirect.init() pathname = location.pathname.split '/' URL = Redirect.to 'file',