Fix bugs in loading from HTTP-only archives on HTTPS pages.

This commit is contained in:
ccd0 2014-11-17 21:20:10 -08:00
parent 128b344294
commit f7759216ca
2 changed files with 2 additions and 2 deletions

View File

@ -77,7 +77,7 @@ CrossOrigin = do ->
<% if (type === 'userscript') { %>
GM_xmlhttpRequest
method: "GET"
url: url
url: url+''
onload: (xhr) ->
response = JSON.parse xhr.responseText
cb response for cb in callbacks[url]

View File

@ -154,7 +154,7 @@ Get =
if media then for key of media when /_link$/.test key
# 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].match(/^(http:\/\/[^\/]+\/)?/)[0] in url.archive.imagehosts
delete media[key] unless media[key]? and media[key].match(/^(http:\/\/[^\/]+\/)?/)[0] in url.archive.imagehosts
Get.parseArchivedPost response, boardID, postID, root, context
return true
return false