From 2cbc2f5261b521d8c62c1bd999647aac4f52c080 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 11 Dec 2018 12:30:48 +0300 Subject: bring back frontend sanity check w/ App.checkBrowserFeatures() --- js/tt-rss.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'js/tt-rss.js') diff --git a/js/tt-rss.js b/js/tt-rss.js index 143546ad0..26b1f7bba 100644 --- a/js/tt-rss.js +++ b/js/tt-rss.js @@ -65,6 +65,9 @@ require(["dojo/_base/kernel", constructor: function () { parser.parse(); + if (!this.checkBrowserFeatures()) + return; + this.setLoadingProgress(30); this.initHotkeyActions(); @@ -89,6 +92,22 @@ require(["dojo/_base/kernel", } }); }, + checkBrowserFeatures: function() { + let errorMsg = ""; + + ['requestIdleCallback', 'MutationObserver'].each(function(wf) { + if (! (wf in window)) { + errorMsg = `Browser feature check failed: window.${wf} not found.`; + throw $break; + } + }); + + if (errorMsg) { + fatalError(4, errorMsg, navigator.userAgent); + } + + return errorMsg == ""; + }, initSecondStage: function () { this.enableCsrfSupport(); -- cgit v1.2.3-54-g00ecf