From 4d49fc3cdf3c65971c1142925706b9d30ac92593 Mon Sep 17 00:00:00 2001 From: trisua Date: Fri, 11 Jul 2025 19:39:46 -0400 Subject: [PATCH] fix: littleweb browser url --- crates/app/src/public/html/littleweb/browser.lisp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/crates/app/src/public/html/littleweb/browser.lisp b/crates/app/src/public/html/littleweb/browser.lisp index 67c64ab..9379357 100644 --- a/crates/app/src/public/html/littleweb/browser.lisp +++ b/crates/app/src/public/html/littleweb/browser.lisp @@ -125,6 +125,14 @@ // ... console.log(\"navigate\", uri); document.getElementById(\"browser_iframe\").src = `{{ config.lw_host|safe }}/api/v1/net/${uri}?s={{ session }}`; + + if (!uri.includes(\"atto://\")) { + document.getElementById(\"uri\").setAttribute(\"true_value\", `atto://${uri}`); + } else { + document.getElementById(\"uri\").setAttribute(\"true_value\", uri); + } + + document.getElementById(\"uri\").value = uri.replace(\"atto://\", \"\").split(\"/\")[0]; } document.getElementById(\"browser_iframe\").addEventListener(\"load\", (e) => { @@ -156,7 +164,7 @@ document.getElementById(\"uri\").setAttribute(\"true_value\", uri); } - document.getElementById(\"uri\").value = uri.split(\"/\")[0]; + document.getElementById(\"uri\").value = uri.replace(\"atto://\", \"\").split(\"/\")[0]; } });