2022-04-16 18:25:42 +00:00
|
|
|
// mainly this is just to make life easier when debugging stuff like hover
|
2021-03-31 20:54:16 +00:00
|
|
|
export default function ExperimentalInit() {
|
|
|
|
if (localStorage.getItem('debug') === 'true') {
|
|
|
|
document.onkeydown = (e) => {
|
|
|
|
e = e || window.event;
|
2021-06-13 12:47:18 +00:00
|
|
|
|
2021-03-31 20:54:16 +00:00
|
|
|
if (!e.ctrlKey) {
|
|
|
|
return;
|
|
|
|
}
|
2021-06-13 12:47:18 +00:00
|
|
|
|
|
|
|
const code = e.which || e.keyCode;
|
2021-03-31 20:54:16 +00:00
|
|
|
|
|
|
|
switch (code) {
|
|
|
|
case 222:
|
2021-04-02 12:24:18 +00:00
|
|
|
const timeout = localStorage.getItem('debugtimeout');
|
|
|
|
|
|
|
|
if (timeout !== '0') {
|
|
|
|
setTimeout(() => {
|
|
|
|
debugger;
|
|
|
|
}, timeout);
|
|
|
|
} else {
|
|
|
|
debugger;
|
|
|
|
}
|
2021-03-31 20:54:16 +00:00
|
|
|
break;
|
2022-04-11 21:57:07 +00:00
|
|
|
default:
|
|
|
|
break;
|
2021-03-31 20:54:16 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|