fix: close #245, port various fixes from 7.0

This commit is contained in:
David Ralph
2022-03-06 17:28:25 +00:00
parent 66e22b05ef
commit 66da158840
9 changed files with 19 additions and 34 deletions

View File

@@ -110,23 +110,11 @@ export function loadSettings(hotreload) {
`);
}
// everything below this either doesn't support hot reload (custom js) or shouldn't run on a hot reload event
// everything below this shouldn't run on a hot reload event
if (hotreload === true) {
return;
}
if (window.location.href.startsWith('http://') || window.location.href.startsWith('https://')){
const js = localStorage.getItem('customjs');
if (js) {
try {
// eslint-disable-next-line no-eval
eval(js);
} catch (e) {
console.error('Failed to run custom JS: ', e);
}
}
}
if (localStorage.getItem('experimental') === 'true') {
experimentalInit();
}