1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-13 10:55:56 +00:00

* it feels weird for requireIdleCallback() to be optional while more

modern browser features are required
 * simplify browser startup feature check a bit
This commit is contained in:
Andrew Dolgov
2021-03-10 19:53:09 +03:00
parent 84fe383ed4
commit 143617afb1
4 changed files with 14 additions and 21 deletions

View File

@@ -688,15 +688,16 @@ const App = {
checkBrowserFeatures: function() {
let errorMsg = "";
['MutationObserver'].forEach(function(wf) {
if (!(wf in window)) {
errorMsg = `Browser feature check failed: <code>window.${wf}</code> not found.`;
['MutationObserver', 'requestIdleCallback'].forEach((t) => {
if (!(t in window)) {
errorMsg = `Browser check failed: <code>window.${t}</code> not found.`;
throw new Error(errorMsg);
}
});
if (errorMsg) {
this.Error.fatal(errorMsg, {info: navigator.userAgent});
if (typeof Promise.allSettled == "undefined") {
errorMsg = `Browser check failed: <code>Promise.allSettled</code> is not defined.`;
throw new Error(errorMsg);
}
return errorMsg == "";