Fixes URL polyfill check for MS Edge.

This commit is contained in:
Yury Delendik 2016-01-26 16:49:44 -06:00
parent 0558ffcbf9
commit bc30c42758

View File

@ -1697,13 +1697,15 @@ function loadJpegStream(id, imageUrl, objs) {
// feature detect for URL constructor
var hasWorkingUrl = false;
if (typeof URL === 'function' && ('origin' in URL.prototype)) {
try {
try {
if (typeof URL === 'function' &&
typeof URL.prototype === 'object' &&
('origin' in URL.prototype)) {
var u = new URL('b', 'http://a');
u.pathname = 'c%20d';
hasWorkingUrl = u.href === 'http://a/c%20d';
} catch(e) {}
}
}
} catch(e) { }
if (hasWorkingUrl)
return;