Merge pull request #1119 from JustAMan/workaround-buggy-promise

Add check for funky Promise faced on WebOS 2
This commit is contained in:
dkanada 2020-04-24 23:15:06 +09:00 committed by GitHub
commit bd57d5dfb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,6 +29,16 @@
); );
} }
try {
Promise.resolve();
} catch (ex) {
// this checks for several cases actually, typical is
// Promise() being missing on some legacy browser, and a funky one
// is Promise() present but buggy on WebOS 2
window.Promise = undefined;
self.Promise = undefined;
}
if (!self.Promise) { if (!self.Promise) {
// Load Promise polyfill if they are not natively supported // Load Promise polyfill if they are not natively supported
injectScriptElement( injectScriptElement(