detect misconfiguration and abort

This commit is contained in:
ansuz 2022-03-16 10:52:51 +05:30
parent 2bffce391a
commit 04486040c3
1 changed files with 9 additions and 0 deletions
www/common

View File

@ -43,5 +43,14 @@ define([
throw e;
};
var caughtEval;
try { eval('true'); } catch (err) { caughtEval = true; }
if (!/^\/(sheet|doc|presentation)/.test(window.location.pathname) && !caughtEval) {
return void setTimeout(function () {
alert("aborting because eval should not be permitted.");
});
}
require([document.querySelector('script[data-bootload]').getAttribute('data-bootload')]);
});