Skip to content

Commit 1f2910b

Browse files
committed
Merge pull request mozilla#6928 from yurydelendik/url-check
Fixes URL polyfill check for MS Edge.
2 parents 0558ffc + bc30c42 commit 1f2910b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/shared/util.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,13 +1697,15 @@ function loadJpegStream(id, imageUrl, objs) {
16971697

16981698
// feature detect for URL constructor
16991699
var hasWorkingUrl = false;
1700-
if (typeof URL === 'function' && ('origin' in URL.prototype)) {
1701-
try {
1700+
try {
1701+
if (typeof URL === 'function' &&
1702+
typeof URL.prototype === 'object' &&
1703+
('origin' in URL.prototype)) {
17021704
var u = new URL('b', 'http://a');
17031705
u.pathname = 'c%20d';
17041706
hasWorkingUrl = u.href === 'http://a/c%20d';
1705-
} catch(e) {}
1706-
}
1707+
}
1708+
} catch(e) { }
17071709

17081710
if (hasWorkingUrl)
17091711
return;

0 commit comments

Comments
 (0)