From 4aba46e2473aeee94d2bbae2dab56918e796570e Mon Sep 17 00:00:00 2001 From: Obexer Christoph Date: Fri, 18 Nov 2011 12:30:20 +0100 Subject: [PATCH] fix origin check in IE --- src/Preload.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Preload.js b/src/Preload.js index 878cdf1..94f4034 100644 --- a/src/Preload.js +++ b/src/Preload.js @@ -12,7 +12,7 @@ html2canvas.Preload = function(element, opts){ "proxy": "http://html2canvas.appspot.com/" }, images = [], - pageOrigin = window.location.protocol + window.location.host, + pageOrigin, imagesLoaded = 0, methods, i, @@ -22,6 +22,8 @@ html2canvas.Preload = function(element, opts){ imgLen = domImages.length, link = doc.createElement("a"); + link.href = window.location.href; + pageOrigin = link.protocol + link.host; opts = opts || {}; options = html2canvas.Util.Extend(opts, options); @@ -32,8 +34,8 @@ html2canvas.Preload = function(element, opts){ function isSameOrigin(url){ link.href = url; - return ((link.protocol + link.host) === pageOrigin); - + var origin = link.protocol + link.host; + return ":" === origin || (origin === pageOrigin); } function getIndex(array,src){