Update support for https with sys.4chan.org. Fix #328

This commit is contained in:
Nicolas Stepien 2012-03-14 20:52:58 +01:00
parent 1e6e4743dc
commit 5ca4a015cc
4 changed files with 10 additions and 6 deletions

View File

@ -8,6 +8,7 @@
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/*
// @include http://images.4chan.org/*
// @include https://sys.4chan.org/*
// @include http://sys.4chan.org/*
// @include http://www.4chan.org/*
// @run-at document-start
@ -1260,7 +1261,7 @@
} else {
iframe = $.el('iframe', {
id: 'iframe',
src: 'http://sys.4chan.org/robots.txt'
src: 'https://sys.4chan.org/robots.txt'
});
$.on(iframe, 'error', function() {
return this.src = this.src;
@ -1269,7 +1270,7 @@
if (!qr.status.ready) {
iframe.src = 'about:blank';
return setTimeout((function() {
return iframe.src = 'http://sys.4chan.org/robots.txt';
return iframe.src = 'https://sys.4chan.org/robots.txt';
}), 100);
}
};
@ -2020,7 +2021,7 @@
},
post: function(data) {
var boundary, callbacks, form, i, name, opts, parts, toBin, url, val;
url = "http://sys.4chan.org/" + data.board + "/post";
url = "https://sys.4chan.org/" + data.board + "/post";
delete data.board;
if (engine === 'gecko' && data.upfile) {
if (!data.binary) {

View File

@ -15,6 +15,7 @@ HEADER = """
// @license MIT; http://en.wikipedia.org/wiki/Mit_license
// @include http://boards.4chan.org/*
// @include http://images.4chan.org/*
// @include https://sys.4chan.org/*
// @include http://sys.4chan.org/*
// @include http://www.4chan.org/*
// @run-at document-start

View File

@ -1,4 +1,6 @@
master
- Mayhem
Update posting support to use https with sys.4chan.org according to 4chan's latest change. This fixes the 'referer' error.
2.29.0
- Mayhem

View File

@ -1036,13 +1036,13 @@ qr =
else
iframe = $.el 'iframe',
id: 'iframe'
src: 'http://sys.4chan.org/robots.txt'
src: 'https://sys.4chan.org/robots.txt'
$.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/robots.txt'), 100
setTimeout (-> iframe.src = 'https://sys.4chan.org/robots.txt'), 100
$.on iframe, 'load', -> if @src isnt 'about:blank' then setTimeout loadChecking, 500, @
$.add d.head, iframe
@ -1694,7 +1694,7 @@ qr =
post: (data) ->
url = "http://sys.4chan.org/#{data.board}/post"
url = "https://sys.4chan.org/#{data.board}/post"
# Do not append these values to the form.
delete data.board