Fix bugs in loading from HTTP-only archives on HTTPS pages.
This commit is contained in:
parent
128b344294
commit
f7759216ca
@ -77,7 +77,7 @@ CrossOrigin = do ->
|
|||||||
<% if (type === 'userscript') { %>
|
<% if (type === 'userscript') { %>
|
||||||
GM_xmlhttpRequest
|
GM_xmlhttpRequest
|
||||||
method: "GET"
|
method: "GET"
|
||||||
url: url
|
url: url+''
|
||||||
onload: (xhr) ->
|
onload: (xhr) ->
|
||||||
response = JSON.parse xhr.responseText
|
response = JSON.parse xhr.responseText
|
||||||
cb response for cb in callbacks[url]
|
cb response for cb in callbacks[url]
|
||||||
|
|||||||
@ -154,7 +154,7 @@ Get =
|
|||||||
if media then for key of media when /_link$/.test key
|
if media then for key of media when /_link$/.test key
|
||||||
# Image/thumbnail URLs loaded over HTTP can be modified in transit.
|
# 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.
|
# 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
|
Get.parseArchivedPost response, boardID, postID, root, context
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user