Fix cors loading of images

This commit is contained in:
Niklas von Hertzen
2014-05-18 17:40:01 +03:00
parent b7595e19e9
commit 9ee87339a3
5 changed files with 46 additions and 15 deletions

View File

@ -2,7 +2,7 @@ function ImageLoader(options, support) {
this.link = null;
this.options = options;
this.support = support;
this.origin = window.location.protocol + window.location.hostname;
this.origin = window.location.protocol + window.location.hostname + window.location.port;
}
ImageLoader.prototype.findImages = function(nodes) {
@ -60,7 +60,7 @@ ImageLoader.prototype.isSameOrigin = function(url) {
var link = this.link || (this.link = document.createElement("a"));
link.href = url;
link.href = link.href; // IE9, LOL! - http://jsfiddle.net/niklasvh/2e48b/
var origin = link.protocol + link.hostname;
var origin = link.protocol + link.hostname + link.port;
return (origin === this.origin);
};