From 31553fa7d6a68077d60046b990f43cefddf1f3cb Mon Sep 17 00:00:00 2001 From: Emmeran Seehuber Date: Tue, 29 Aug 2017 18:10:14 +0200 Subject: [PATCH] Fix 'Uncaught ReferenceError: Promise is not defined' errors on Android devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I’ve implemented a global window error handler on my page, which logs all javascript errors on my server. In this error log I get some „Promise is not defined“ errors caused by the font watcher when running on some strange Android browser versions. --- src/core/fontwatcher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/fontwatcher.js b/src/core/fontwatcher.js index 66f8f461..4f0d24c2 100644 --- a/src/core/fontwatcher.js +++ b/src/core/fontwatcher.js @@ -64,7 +64,7 @@ goog.scope(function () { } else if (safari10Match) { FontWatcher.SHOULD_USE_NATIVE_LOADER = false; } else { - FontWatcher.SHOULD_USE_NATIVE_LOADER = true; + FontWatcher.SHOULD_USE_NATIVE_LOADER = !!window.Promise; } } else { FontWatcher.SHOULD_USE_NATIVE_LOADER = false;