include localstore on the crashpage

This commit is contained in:
ed 2021-07-20 23:22:35 +02:00
parent 99f6ed0cd7
commit 23b8901c9c

View file

@ -31,17 +31,21 @@ function vis_exh(msg, url, lineNo, columnNo, error) {
var html = ['<h1>you hit a bug!</h1><p style="font-size:1.3em;margin:0">try to <a href="#" onclick="localStorage.clear();location.reload();" style="text-decoration:underline;color:#fc0">reset copyparty settings</a> if you are stuck here</p><p>please send me a screenshot arigathanks gozaimuch: <code>ed/irc.rizon.net</code> or <code>ed#2644</code><br />&nbsp; (and if you can, press F12 and include the "Console" tab in the screenshot too)</p><p>', var html = ['<h1>you hit a bug!</h1><p style="font-size:1.3em;margin:0">try to <a href="#" onclick="localStorage.clear();location.reload();" style="text-decoration:underline;color:#fc0">reset copyparty settings</a> if you are stuck here</p><p>please send me a screenshot arigathanks gozaimuch: <code>ed/irc.rizon.net</code> or <code>ed#2644</code><br />&nbsp; (and if you can, press F12 and include the "Console" tab in the screenshot too)</p><p>',
esc(url + ' @' + lineNo + ':' + columnNo), '<br />' + esc(String(msg)) + '</p>']; esc(url + ' @' + lineNo + ':' + columnNo), '<br />' + esc(String(msg)) + '</p>'];
if (error) { try {
var find = ['desc', 'stack', 'trace']; if (error) {
for (var a = 0; a < find.length; a++) var find = ['desc', 'stack', 'trace'];
if (String(error[find[a]]) !== 'undefined') for (var a = 0; a < find.length; a++)
html.push('<h3>' + find[a] + '</h3>' + if (String(error[find[a]]) !== 'undefined')
esc(String(error[find[a]])).replace(/\n/g, '<br />\n')); html.push('<h3>' + find[a] + '</h3>' +
esc(String(error[find[a]])).replace(/\n/g, '<br />\n'));
}
html.push('<h3>localStore</h3>' + esc(JSON.stringify(localStorage)));
} }
catch (e) { }
document.body.innerHTML = html.join('\n'); document.body.innerHTML = html.join('\n');
var s = mknod('style'); var s = mknod('style');
s.innerHTML = 'body{background:#333;color:#ddd;font-family:sans-serif;font-size:0.8em;padding:0 1em 1em 1em} h1{margin:.5em 1em 0 0;padding:0} h3{border-top:1px solid #999;margin:0} code{color:#bf7;background:#222;padding:.1em;margin:.2em;font-size:1.1em;font-family:monospace,monospace} *{line-height:1.5em}'; s.innerHTML = 'body{background:#333;color:#ddd;font-family:sans-serif;font-size:0.8em;padding:0 1em 1em 1em} h1{margin:.5em 1em 0 0;padding:0} h3{border-top:1px solid #999;margin:1em 0 0 0} code{color:#bf7;background:#222;padding:.1em;margin:.2em;font-size:1.1em;font-family:monospace,monospace} *{line-height:1.5em}';
document.head.appendChild(s); document.head.appendChild(s);
throw 'fatal_err'; throw 'fatal_err';