Merge pull request #6928 from yurydelendik/url-check
Fixes URL polyfill check for MS Edge.
This commit is contained in:
commit
1f2910b2a2
@ -1697,13 +1697,15 @@ function loadJpegStream(id, imageUrl, objs) {
|
|||||||
|
|
||||||
// feature detect for URL constructor
|
// feature detect for URL constructor
|
||||||
var hasWorkingUrl = false;
|
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');
|
var u = new URL('b', 'http://a');
|
||||||
u.pathname = 'c%20d';
|
u.pathname = 'c%20d';
|
||||||
hasWorkingUrl = u.href === 'http://a/c%20d';
|
hasWorkingUrl = u.href === 'http://a/c%20d';
|
||||||
} catch(e) {}
|
|
||||||
}
|
}
|
||||||
|
} catch(e) { }
|
||||||
|
|
||||||
if (hasWorkingUrl)
|
if (hasWorkingUrl)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user