Handle http/s for iframes depending on the normal post form's protocol.
This commit is contained in:
parent
64f8b86b45
commit
7ac8f016f3
@ -1226,7 +1226,7 @@
|
|||||||
return setTimeout(this.asyncInit);
|
return setTimeout(this.asyncInit);
|
||||||
},
|
},
|
||||||
asyncInit: function() {
|
asyncInit: function() {
|
||||||
var form, iframe, link, loadChecking, script;
|
var form, iframe, link, loadChecking, script, src;
|
||||||
if (Conf['Hide Original Post Form']) {
|
if (Conf['Hide Original Post Form']) {
|
||||||
link = $.el('h1', {
|
link = $.el('h1', {
|
||||||
innerHTML: "<a href=javascript:;>" + (g.REPLY ? 'Quick Reply' : 'New Thread') + "</a>"
|
innerHTML: "<a href=javascript:;>" + (g.REPLY ? 'Quick Reply' : 'New Thread') + "</a>"
|
||||||
@ -1244,9 +1244,10 @@
|
|||||||
ready: true
|
ready: true
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
src = "http" + (/^https/.test(form.action) ? 's' : '') + "://sys.4chan.org/robots.txt";
|
||||||
iframe = $.el('iframe', {
|
iframe = $.el('iframe', {
|
||||||
id: 'iframe',
|
id: 'iframe',
|
||||||
src: 'https://sys.4chan.org/robots.txt'
|
src: src
|
||||||
});
|
});
|
||||||
$.on(iframe, 'error', function() {
|
$.on(iframe, 'error', function() {
|
||||||
return this.src = this.src;
|
return this.src = this.src;
|
||||||
@ -1255,7 +1256,7 @@
|
|||||||
if (!QR.status.ready) {
|
if (!QR.status.ready) {
|
||||||
iframe.src = 'about:blank';
|
iframe.src = 'about:blank';
|
||||||
return setTimeout((function() {
|
return setTimeout((function() {
|
||||||
return iframe.src = 'https://sys.4chan.org/robots.txt';
|
return iframe.src = src;
|
||||||
}), 100);
|
}), 100);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1023,15 +1023,16 @@ QR =
|
|||||||
if /chrome/i.test navigator.userAgent
|
if /chrome/i.test navigator.userAgent
|
||||||
QR.status ready: true
|
QR.status ready: true
|
||||||
else
|
else
|
||||||
|
src = "http#{if /^https/.test form.action then 's' else ''}://sys.4chan.org/robots.txt"
|
||||||
iframe = $.el 'iframe',
|
iframe = $.el 'iframe',
|
||||||
id: 'iframe'
|
id: 'iframe'
|
||||||
src: 'https://sys.4chan.org/robots.txt'
|
src: src
|
||||||
$.on iframe, 'error', -> @src = @src
|
$.on iframe, 'error', -> @src = @src
|
||||||
# Greasemonkey ghetto fix
|
# Greasemonkey ghetto fix
|
||||||
loadChecking = (iframe) ->
|
loadChecking = (iframe) ->
|
||||||
unless QR.status.ready
|
unless QR.status.ready
|
||||||
iframe.src = 'about:blank'
|
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, @
|
$.on iframe, 'load', -> if @src isnt 'about:blank' then setTimeout loadChecking, 500, @
|
||||||
$.add d.head, iframe
|
$.add d.head, iframe
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user