diff --git a/4chan_x.user.js b/4chan_x.user.js index d7c10c426..f218a16db 100644 --- a/4chan_x.user.js +++ b/4chan_x.user.js @@ -1226,7 +1226,7 @@ return setTimeout(this.asyncInit); }, asyncInit: function() { - var form, iframe, link, loadChecking, script; + var form, iframe, link, loadChecking, script, src; if (Conf['Hide Original Post Form']) { link = $.el('h1', { innerHTML: "" + (g.REPLY ? 'Quick Reply' : 'New Thread') + "" @@ -1244,9 +1244,10 @@ ready: true }); } else { + src = "http" + (/^https/.test(form.action) ? 's' : '') + "://sys.4chan.org/robots.txt"; iframe = $.el('iframe', { id: 'iframe', - src: 'https://sys.4chan.org/robots.txt' + src: src }); $.on(iframe, 'error', function() { return this.src = this.src; @@ -1255,7 +1256,7 @@ if (!QR.status.ready) { iframe.src = 'about:blank'; return setTimeout((function() { - return iframe.src = 'https://sys.4chan.org/robots.txt'; + return iframe.src = src; }), 100); } }; diff --git a/script.coffee b/script.coffee index 56c3baa63..8beb6d587 100644 --- a/script.coffee +++ b/script.coffee @@ -1023,15 +1023,16 @@ QR = if /chrome/i.test navigator.userAgent QR.status ready: true else + src = "http#{if /^https/.test form.action then 's' else ''}://sys.4chan.org/robots.txt" iframe = $.el 'iframe', id: 'iframe' - src: 'https://sys.4chan.org/robots.txt' + src: src $.on iframe, 'error', -> @src = @src # Greasemonkey ghetto fix loadChecking = (iframe) -> unless QR.status.ready iframe.src = 'about:blank' - setTimeout (-> iframe.src = 'https://sys.4chan.org/robots.txt'), 100 + setTimeout (-> iframe.src = src), 100 $.on iframe, 'load', -> if @src isnt 'about:blank' then setTimeout loadChecking, 500, @ $.add d.head, iframe