mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
fix origin check in IE
This commit is contained in:
parent
2a3d6a0a35
commit
4aba46e247
@ -12,7 +12,7 @@ html2canvas.Preload = function(element, opts){
|
|||||||
"proxy": "http://html2canvas.appspot.com/"
|
"proxy": "http://html2canvas.appspot.com/"
|
||||||
},
|
},
|
||||||
images = [],
|
images = [],
|
||||||
pageOrigin = window.location.protocol + window.location.host,
|
pageOrigin,
|
||||||
imagesLoaded = 0,
|
imagesLoaded = 0,
|
||||||
methods,
|
methods,
|
||||||
i,
|
i,
|
||||||
@ -22,6 +22,8 @@ html2canvas.Preload = function(element, opts){
|
|||||||
imgLen = domImages.length,
|
imgLen = domImages.length,
|
||||||
link = doc.createElement("a");
|
link = doc.createElement("a");
|
||||||
|
|
||||||
|
link.href = window.location.href;
|
||||||
|
pageOrigin = link.protocol + link.host;
|
||||||
opts = opts || {};
|
opts = opts || {};
|
||||||
|
|
||||||
options = html2canvas.Util.Extend(opts, options);
|
options = html2canvas.Util.Extend(opts, options);
|
||||||
@ -32,8 +34,8 @@ html2canvas.Preload = function(element, opts){
|
|||||||
|
|
||||||
function isSameOrigin(url){
|
function isSameOrigin(url){
|
||||||
link.href = url;
|
link.href = url;
|
||||||
return ((link.protocol + link.host) === pageOrigin);
|
var origin = link.protocol + link.host;
|
||||||
|
return ":" === origin || (origin === pageOrigin);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getIndex(array,src){
|
function getIndex(array,src){
|
||||||
|
Loading…
Reference in New Issue
Block a user