diff --git a/js/common.js b/js/common.js index 210a1c6cc..17d1fe444 100755 --- a/js/common.js +++ b/js/common.js @@ -266,15 +266,18 @@ function fatalError(code, msg, ext_info) { msg = ERRORS[code]; } - let content = "
Error code: " + code + "
" + - "

" + msg + "

"; + let content = `
Error code: ${code}
+

${msg}

`; if (ext_info) { - content = content + "
Additional information:
" + - ""; + content = content + `
Additional information:
+ `; } + content += `
+
`; + const dialog = new dijit.Dialog({ title: "Fatal error", style: "width: 600px", 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();