From c5b06c7d9c43a7109b86421fd32eb6f2b757477f Mon Sep 17 00:00:00 2001 From: Nicolas Stepien Date: Tue, 7 Feb 2012 16:26:28 +0100 Subject: [PATCH] HOLY BALLS, load QR's iframe faster. Close #192 --- 4chan_x.user.js | 6 +++--- changelog | 1 + script.coffee | 6 +++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/4chan_x.user.js b/4chan_x.user.js index 1ae193ba1..c42d13b4a 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1207,7 +1207,7 @@ iframe = $.el('iframe', { id: 'iframe', hidden: true, - src: 'http://sys.4chan.org/post' + src: 'http://sys.4chan.org/favicon.ico' }); $.on(iframe, 'error', function() { return this.src = this.src; @@ -1216,7 +1216,7 @@ if (!qr.status.ready) { iframe.src = 'about:blank'; return setTimeout((function() { - return iframe.src = 'http://sys.4chan.org/post'; + return iframe.src = 'http://sys.4chan.org/favicon.ico'; }), 250); } }; @@ -3433,7 +3433,7 @@ } $.on(window, 'message', Main.message); if (location.hostname === 'sys.4chan.org') { - if (location.pathname === '/post') { + if (location.pathname === '/favicon.ico') { qr.message.init(); } else if (/report/.test(location.search)) { $.ready(function() { diff --git a/changelog b/changelog index 8e5766236..8ac257ce3 100644 --- a/changelog +++ b/changelog @@ -2,6 +2,7 @@ master - aeosynth prevent post form flicker - Mayhem + Load QR's iframe to sys.4chan.org faster. Thanks desuwa. Increase Sauce linking possibilites: Thumbnails, full images, MD5 hashes. New option: Recursive Filtering: Filter replies of filtered posts. diff --git a/script.coffee b/script.coffee index 3606d51bb..130757984 100644 --- a/script.coffee +++ b/script.coffee @@ -880,13 +880,13 @@ qr = iframe = $.el 'iframe', id: 'iframe' hidden: true - src: 'http://sys.4chan.org/post' + src: 'http://sys.4chan.org/favicon.ico' $.on iframe, 'error', -> @src = @src # Greasemonkey ghetto fix loadChecking = (iframe) -> unless qr.status.ready iframe.src = 'about:blank' - setTimeout (-> iframe.src = 'http://sys.4chan.org/post'), 250 + setTimeout (-> iframe.src = 'http://sys.4chan.org/favicon.ico'), 250 $.on iframe, 'load', -> unless @src is 'about:blank' then setTimeout loadChecking, 250, @ $.add d.body, iframe @@ -2660,7 +2660,7 @@ Main = $.on window, 'message', Main.message if location.hostname is 'sys.4chan.org' - if location.pathname is '/post' + if location.pathname is '/favicon.ico' qr.message.init() else if /report/.test location.search $.ready ->