From d955ef0e0ededf9b3a7aad173388d1e9a86c1c43 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Sun, 25 Sep 2011 01:32:43 +0200 Subject: [PATCH] Opera will always retry unless the thread died. --- 4chan_x.user.js | 16 ++++++++++------ script.coffee | 7 +++++-- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index c33e9a5a9..8b629b8f2 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2737,12 +2737,16 @@ var req, thumb; thumb = this.previousSibling; imgExpand.contract(thumb); - req = $.ajax(this.src, null, 'head'); - return req.onreadystatechange = function(e) { - if (this.status !== 404) { - return setTimeout(imgExpand.retry, 10000, thumb); - } - }; + if (navigator.appName !== 'Opera') { + req = $.ajax(this.src, null, 'head'); + return req.onreadystatechange = function(e) { + if (this.status !== 404) { + return setTimeout(imgExpand.retry, 10000, thumb); + } + }; + } else if (!g.dead) { + return setTimeout(imgExpand.retry, 10000, thumb); + } }, retry: function(thumb) { if (!thumb.hidden) { diff --git a/script.coffee b/script.coffee index fd975629e..bba83ab60 100644 --- a/script.coffee +++ b/script.coffee @@ -2026,8 +2026,11 @@ imgExpand = thumb = @previousSibling imgExpand.contract thumb #navigator.online is not x-browser/os yet - req = $.ajax @src, null, 'head' - req.onreadystatechange = (e) -> setTimeout imgExpand.retry, 10000, thumb if @status isnt 404 + if navigator.appName isnt 'Opera' + req = $.ajax @src, null, 'head' + req.onreadystatechange = (e) -> setTimeout imgExpand.retry, 10000, thumb if @status isnt 404 + else unless g.dead + setTimeout imgExpand.retry, 10000, thumb retry: (thumb) -> imgExpand.expand thumb unless thumb.hidden