mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fix origin check for IE (#460)
This commit is contained in:
parent
e103ad8219
commit
6073928978
9
dist/html2canvas.js
vendored
9
dist/html2canvas.js
vendored
@ -935,7 +935,7 @@ function ImageLoader(options, support) {
|
||||
this.link = null;
|
||||
this.options = options;
|
||||
this.support = support;
|
||||
this.origin = window.location.protocol + window.location.hostname + window.location.port;
|
||||
this.origin = this.getOrigin(window.location.href);
|
||||
}
|
||||
|
||||
ImageLoader.prototype.findImages = function(nodes) {
|
||||
@ -1019,11 +1019,14 @@ ImageLoader.prototype.imageExists = function(images, src) {
|
||||
};
|
||||
|
||||
ImageLoader.prototype.isSameOrigin = function(url) {
|
||||
return (this.getOrigin(url) === this.origin);
|
||||
};
|
||||
|
||||
ImageLoader.prototype.getOrigin = 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 + link.port;
|
||||
return (origin === this.origin);
|
||||
return link.protocol + link.hostname + link.port;
|
||||
};
|
||||
|
||||
ImageLoader.prototype.getPromise = function(container) {
|
||||
|
4
dist/html2canvas.min.js
vendored
4
dist/html2canvas.min.js
vendored
File diff suppressed because one or more lines are too long
@ -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 + window.location.port;
|
||||
this.origin = this.getOrigin(window.location.href);
|
||||
}
|
||||
|
||||
ImageLoader.prototype.findImages = function(nodes) {
|
||||
@ -86,11 +86,14 @@ ImageLoader.prototype.imageExists = function(images, src) {
|
||||
};
|
||||
|
||||
ImageLoader.prototype.isSameOrigin = function(url) {
|
||||
return (this.getOrigin(url) === this.origin);
|
||||
};
|
||||
|
||||
ImageLoader.prototype.getOrigin = 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 + link.port;
|
||||
return (origin === this.origin);
|
||||
return link.protocol + link.hostname + link.port;
|
||||
};
|
||||
|
||||
ImageLoader.prototype.getPromise = function(container) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user