From 54f4ec2038504078d711490c93904a9a63dbcdb0 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 11 Sep 2012 15:13:48 +0200 Subject: [PATCH] Don't try to reload an image hover if it's not in the document. --- 4chan_x.user.js | 3 +++ script.coffee | 1 + 2 files changed, 4 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index ce810777e..3c38f41f7 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -2297,6 +2297,9 @@ error: function() { var src, timeoutID, url, _this = this; + if (!this.parentNode) { + return; + } src = this.src.split('/'); if (!(src[2] === 'images.4chan.org' && (url = Redirect.image(src[3], src[5])))) { if (g.DEAD) { diff --git a/script.coffee b/script.coffee index 48004e0db..430d97430 100644 --- a/script.coffee +++ b/script.coffee @@ -1935,6 +1935,7 @@ ImageHover = clientX: - 45 + parseInt style.left clientY: 120 + parseInt style.top error: -> + return unless @parentNode src = @src.split '/' unless src[2] is 'images.4chan.org' and url = Redirect.image src[3], src[5] return if g.DEAD