mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-18 14:53:14 +00:00
feature test URL support
This commit is contained in:
parent
6a51f53940
commit
47d9bf0b9b
@ -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');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user