From 03ce6c97ff34460b70b83b867f2aeb99a8cf9ffc Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 30 Aug 2021 01:15:37 +0200 Subject: [PATCH] better crash-handler ui --- copyparty/web/util.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/copyparty/web/util.js b/copyparty/web/util.js index a6646d52..81e8cf53 100644 --- a/copyparty/web/util.js +++ b/copyparty/web/util.js @@ -39,7 +39,8 @@ function vis_exh(msg, url, lineNo, columnNo, error) { crashed = true; window.onerror = undefined; - var html = ['

you hit a bug!

try to reset copyparty settings if you are stuck here, or ignore this / ignore all

please send me a screenshot arigathanks gozaimuch: ed/irc.rizon.net or ed#2644
  (and if you can, press F12 and include the "Console" tab in the screenshot too)

', + var con = is_touch ? '' : '
  (and if you can, press F12 and include the "Console" tab in the screenshot too)', + html = ['

you hit a bug!

try to reset copyparty settings if you are stuck here, or ignore this / ignore all

please send me a screenshot arigathanks gozaimuch: ed/irc.rizon.net or ed#2644' + con + '

', esc(url + ' @' + lineNo + ':' + columnNo), '
' + esc(String(msg)) + '

']; try { @@ -63,10 +64,10 @@ function vis_exh(msg, url, lineNo, columnNo, error) { document.body.appendChild(exbox); var s = mknod('style'); - s.innerHTML = '#exbox{background:#333;color:#ddd;font-family:sans-serif;font-size:0.8em;padding:0 1em 1em 1em;z-index:80386;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%} #exbox h1{margin:.5em 1em 0 0;padding:0} #exbox h3{border-top:1px solid #999;margin:1em 0 0 0} #exbox a{text-decoration:underline;color:#fc0} #exbox code{color:#bf7;background:#222;padding:.1em;margin:.2em;font-size:1.1em;font-family:monospace,monospace} #exbox *{line-height:1.5em}'; + s.innerHTML = '#exbox{background:#333;color:#ddd;font-family:sans-serif;font-size:0.8em;padding:0 1em 1em 1em;z-index:80386;position:fixed;top:0;left:0;right:0;bottom:0;width:100%;height:100%;overflow:auto;width:calc(100% - 2em)} #exbox h1{margin:.5em 1em 0 0;padding:0} #exbox h3{border-top:1px solid #999;margin:1em 0 0 0} #exbox a{text-decoration:underline;color:#fc0} #exbox code{color:#bf7;background:#222;padding:.1em;margin:.2em;font-size:1.1em;font-family:monospace,monospace} #exbox,#exbox *{line-height:1.5em;overflow-wrap:break-word}'; document.head.appendChild(s); } - exbox.innerHTML = html.join('\n'); + exbox.innerHTML = html.join('\n').replace(/https?:\/\/[^ \/]+\//g, '/'); exbox.style.display = 'block'; } catch (e) {