feature test URL support

This commit is contained in:
guybedford 2015-06-13 15:28:30 +02:00
parent 6a51f53940
commit 47d9bf0b9b

View File

@ -1,7 +1,12 @@
}
// auto-load Promise and URL polyfills if needed in the browser
if (typeof Promise === 'undefined' || (typeof URL !== 'function' && typeof URLPolyfill !== 'function')) {
try {
var hasURL = typeof URLPolyfill != 'undefined' || typeof URL != 'undefined' && new URL('test:///').protocol == 'test:';
}
catch(e) {}
if (typeof Promise === 'undefined' || !hasURL) {
// document.write
if (typeof document !== 'undefined') {
var scripts = document.getElementsByTagName('script');