(core) Avoid loading the Grist frontend app more than once.

Summary:
This can happen thanks to some badly-behaved extensions (e.g. lingvanex), and
results in errors such as "Cannot redefine property: isInput".

Test Plan:
Tested manually that Grist fails to load in Chrome with Lingvanex
extension, and loads successfully with this change.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D3013
This commit is contained in:
Dmitry S 2021-09-04 03:04:52 -04:00
parent 0717ee627e
commit b716a57e31

View File

@ -1,5 +1,13 @@
/* global $, window */
// This is the entry point into loading the whole of Grist frontend application. Some extensions
// attempt to load it more than once (e.g. "Lingvanex"). This leads to duplicated work and errors.
// At least some of such interference can be neutralized by simply ignoring repeated loads.
if (window._gristAppLoaded) {
return;
}
window._gristAppLoaded = true;
const {App} = require('./ui/App');
// Disable longStackTraces, which seem to be enabled in the browser by default.