fix origin check in IE

This commit is contained in:
Obexer Christoph 2011-11-18 12:30:20 +01:00
parent 2a3d6a0a35
commit 4aba46e247

View File

@ -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){