fix: custom js, reminder on reset button etc

This commit is contained in:
David Ralph
2021-06-13 13:47:18 +01:00
parent 1f6dc34ee6
commit 335a6864b1
11 changed files with 50 additions and 38 deletions

View File

@@ -3,10 +3,12 @@ export default function ExperimentalInit() {
if (localStorage.getItem('debug') === 'true') {
document.onkeydown = (e) => {
e = e || window.event;
if (!e.ctrlKey) {
return;
}
let code = e.which || e.keyCode;
const code = e.which || e.keyCode;
switch (code) {
case 222:

View File

@@ -83,7 +83,7 @@ export default class MarketplaceFunctions {
break;
}
let installed = JSON.parse(localStorage.getItem('installed'));
const installed = JSON.parse(localStorage.getItem('installed'));
if (sideload) {
installed.push({

View File

@@ -104,11 +104,6 @@ export default class SettingsFunctions {
document.head.insertAdjacentHTML('beforeend', '<style id="customcss">' + css + '</style>');
}
const js = localStorage.getItem('customjs');
if (js) {
document.head.insertAdjacentHTML('beforeend', '<script id="customjs">' + js + '</script>');
}
const font = localStorage.getItem('font');
if (font) {
const google = localStorage.getItem('fontGoogle');
@@ -147,6 +142,12 @@ export default class SettingsFunctions {
return;
}
const js = localStorage.getItem('customjs');
if (js) {
// eslint-disable-next-line no-eval
eval(js);
}
if (localStorage.getItem('experimental') === 'true') {
experimentalInit();
}