diff --git a/CHANGELOG.md b/CHANGELOG.md index df783adb2..541f2a5f5 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,9 @@ The links to individual versions below are to copies of the script with the upda ### v1.11.2 +**v1.11.2.5** *(2015-07-07)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.2.5/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.2.5/builds/4chan-X-noupdate.crx "Chromium version")] +- Add fireden.net archive. + **v1.11.2.4** *(2015-07-03)* - [[Firefox](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.2.4/builds/4chan-X-noupdate.user.js "Firefox version")] [[Chromium](https://raw.githubusercontent.com/ccd0/4chan-x/1.11.2.4/builds/4chan-X-noupdate.crx "Chromium version")] - Minor bugfixes. diff --git a/src/Archive/archives.json b/src/Archive/archives.json index 95e9d6296..6bf919de2 100644 --- a/src/Archive/archives.json +++ b/src/Archive/archives.json @@ -79,4 +79,13 @@ "software": "foolfuuka", "boards": ["mlp", "qa"], "files": ["mlp", "qa"] +}, { + "uid": 24, + "name": "fireden.net", + "domain": "boards.fireden.net", + "http": false, + "https": true, + "software": "foolfuuka", + "boards": ["cm", "ic", "vg", "y"], + "files": ["cm", "ic", "vg", "y"] }] diff --git a/src/General/lib/fetcher.class b/src/General/lib/fetcher.class index 5a143799d..798084253 100644 --- a/src/General/lib/fetcher.class +++ b/src/General/lib/fetcher.class @@ -81,7 +81,7 @@ class Fetcher return false unless url = Redirect.to 'post', {@boardID, @postID} if /^https:\/\//.test(url) or location.protocol is 'http:' $.cache url, - do (self = @) -> -> self.parseArchivedPost @response + do (self = @) -> -> self.parseArchivedPost @response, url , responseType: 'json' withCredentials: url.archive.withCredentials @@ -93,11 +93,11 @@ class Fetcher # Image/thumbnail URLs loaded over HTTP can be modified in transit. # Require them to be from a known HTTP host so that no referrer is sent to them from an HTTPS page. delete media[key] unless media[key]? and media[key].match(/^(http:\/\/[^\/]+\/)?/)[0] in url.archive.imagehosts - @parseArchivedPost response + @parseArchivedPost response, url return true return false - parseArchivedPost: (data) -> + parseArchivedPost: (data, url) -> # In case of multiple callbacks for the same request, # don't parse the same original post more than once. if post = g.posts["#{@boardID}.#{@postID}"] @@ -147,6 +147,9 @@ class Fetcher commentHTML: comment delete o.info.uniqueID if o.info.capcode if data.media?.media_filename + # Fix URLs missing origin + for key, val of data.media when /_link$/.test(key) and val?[0] is '/' + data.media[key] = url.split('/', 3).join('/') + val o.file = name: data.media.media_filename url: data.media.media_link or data.media.remote_media_link or