From 5c3b7ec9b1ce44282bfb507a69377cf33d4465fe Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 1 Jul 2012 11:47:21 +0200 Subject: [PATCH] Update archive redirection method. --- 4chan_x.user.js | 4 ++-- changelog | 2 ++ script.coffee | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 97dc32aae..fd38abb4b 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -4433,7 +4433,7 @@ case 'images.4chan.org': $.ready(function() { var url; - if (d.title === '4chan - 404' && Conf['404 Redirect']) { + if (/^4chan - 404/.test(d.title) && Conf['404 Redirect']) { path = location.pathname.split('/'); url = Redirect.image(path[1], path[3]); if (url) { @@ -4537,7 +4537,7 @@ }, ready: function() { var MutationObserver, a, board, nav, node, nodes, observer, _i, _j, _len, _len1, _ref, _ref1; - if (d.title === '4chan - 404') { + if (/^4chan - 404/.test(d.title)) { if (Conf['404 Redirect'] && /^\d+$/.test(g.THREAD_ID)) { location.href = Redirect.thread(g.BOARD, g.THREAD_ID, location.hash); } diff --git a/changelog b/changelog index 3b0e81854..3351bd473 100644 --- a/changelog +++ b/changelog @@ -1,4 +1,6 @@ master +- Mayhem + Update/fix archive redirection method. 2.33.5 - Mayhem diff --git a/script.coffee b/script.coffee index ad6d13215..afb12c8d1 100644 --- a/script.coffee +++ b/script.coffee @@ -3414,7 +3414,7 @@ Main = return when 'images.4chan.org' $.ready -> - if d.title is '4chan - 404' and Conf['404 Redirect'] + if /^4chan - 404/.test(d.title) and Conf['404 Redirect'] path = location.pathname.split '/' url = Redirect.image path[1], path[3] location.href = url if url @@ -3512,7 +3512,7 @@ Main = $.ready Main.ready ready: -> - if d.title is '4chan - 404' + if /^4chan - 404/.test d.title if Conf['404 Redirect'] and /^\d+$/.test g.THREAD_ID location.href = Redirect.thread g.BOARD, g.THREAD_ID, location.hash return