From 7964acdce6548ec903814ac43940ffc3d5e6ea33 Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Wed, 1 Feb 2012 23:52:18 +0100 Subject: [PATCH] Ghettofix greasemonkey compatibility since your average Firefox doesn't read changelogs/known bug lists. Close #141. --- 4chan_x.user.js | 9 +++++++++ changelog | 2 ++ script.coffee | 5 +++++ 3 files changed, 16 insertions(+) diff --git a/4chan_x.user.js b/4chan_x.user.js index f2ecdd12b..107ef73a4 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1218,6 +1218,15 @@ $.on(iframe, 'error', function() { return this.src = this.src; }); + $.on(iframe, 'load', function() { + var _this = this; + if (!(qr.status.ready || this.src === 'about:blank')) { + this.src = 'about:blank'; + return setTimeout((function() { + return _this.src = 'http://sys.4chan.org/post'; + }), 250); + } + }); $.add(d.body, iframe); if (conf['Persistent QR']) { qr.dialog(); diff --git a/changelog b/changelog index f30e55045..482d911d1 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,8 @@ master - Mayhem Reverted updater's scrolling behavior. Fix image posting on Firefox along with Unicode characters in the form. + Ghettofix Greasemonkey compatibility with the new QR. + Greasemonkey is still NOT RECOMMENDED, use Scriptish instead. 2.25.1 - Mayhem diff --git a/script.coffee b/script.coffee index 076570f14..8354c442e 100644 --- a/script.coffee +++ b/script.coffee @@ -874,6 +874,11 @@ qr = hidden: true src: 'http://sys.4chan.org/post' $.on iframe, 'error', -> @src = @src + # Greasemonkey ghetto fix + $.on iframe, 'load', -> + unless qr.status.ready or @src is 'about:blank' + @src = 'about:blank' + setTimeout (=> @src = 'http://sys.4chan.org/post'), 250 $.add d.body, iframe if conf['Persistent QR'] qr.dialog()