From a62ba9413dbc38d42adf80a2ef5ba7c5ea7f761c Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Mon, 4 Jun 2012 15:12:26 +0200 Subject: [PATCH] Fix image archive redirection on direct links. --- 4chan_x.user.js | 4 ++-- script.coffee | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 6b4fe2c3f..ad5cdfa54 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -3614,8 +3614,8 @@ Redirect = { init: function() { - var url; - url = location.hostname === 'images.4chan.org' ? this.image(location.href) : /^\d+$/.test(g.THREAD_ID) ? this.thread() : void 0; + var path, url; + url = location.hostname === 'images.4chan.org' ? (path = location.pathname.split('/'), this.image(path[1], path[3])) : /^\d+$/.test(g.THREAD_ID) ? this.thread() : void 0; if (url) { return location.href = url; } diff --git a/script.coffee b/script.coffee index bf1b0a0e0..78a05030d 100644 --- a/script.coffee +++ b/script.coffee @@ -2763,7 +2763,8 @@ Redirect = init: -> url = if location.hostname is 'images.4chan.org' - @image location.href + path = location.pathname.split '/' + @image path[1], path[3] else if /^\d+$/.test g.THREAD_ID @thread() location.href = url if url