From 7a88b9f25d39343da33e37eff2ddbc3d49102c80 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 17 Nov 2016 19:44:20 -0800 Subject: [PATCH] Apply `Use Faster Image Host` to intra-4chan image/webm links. --- src/Images/ImageHost.coffee | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/Images/ImageHost.coffee b/src/Images/ImageHost.coffee index 8d024aeb6..e65dae69b 100644 --- a/src/Images/ImageHost.coffee +++ b/src/Images/ImageHost.coffee @@ -6,7 +6,11 @@ ImageHost = cb: @node node: -> - return unless @file and not @isClone and (m = @file.url.match /^https?:\/\/is\.4chan\.org\/(.*)$/) - @file.link.hostname = 'i.4cdn.org' - @file.thumbLink.hostname = 'i.4cdn.org' if @file.thumbLink - @file.url = @file.link.href + return if @isClone + if @file and (m = @file.url.match /^https?:\/\/is\.4chan\.org\/(.*)$/) + @file.link.hostname = 'i.4cdn.org' + @file.thumbLink.hostname = 'i.4cdn.org' if @file.thumbLink + @file.url = @file.link.href + for link in $$ 'a[href^="http://is.4chan.org/"], a[href^="https://is.4chan.org/"]', @nodes.comment + link.hostname = 'i.4cdn.org' + return