From 7d0719c7d3aa493dba57bda70dfc4ea24fd9cbdf Mon Sep 17 00:00:00 2001 From: Roman Zipp Date: Sat, 3 Jan 2026 12:22:32 +0100 Subject: [PATCH 1/2] Add suggested url via url param when missing stored url --- dashboard/src/entrypoint/main.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dashboard/src/entrypoint/main.ts b/dashboard/src/entrypoint/main.ts index faaa7982..ff66212f 100644 --- a/dashboard/src/entrypoint/main.ts +++ b/dashboard/src/entrypoint/main.ts @@ -6,15 +6,17 @@ async function main() { let url = ""; // Detect if we're running in the (production) webserver included in the matter server or not. - const isProductionServer = location.href.includes(":5580") || location.href.includes("hassio_ingress") || location.href.includes("/api/ingress/"); + const isProductionServer = location.origin.includes(":5580") || location.href.includes("hassio_ingress") || location.href.includes("/api/ingress/"); if (!isProductionServer) { // development server, ask for url to matter server let storageUrl = localStorage.getItem("matterURL"); if (!storageUrl) { + const urlParams = new URLSearchParams(window.location.search); + const suggestedUrl = urlParams.get('url'); storageUrl = prompt( "Enter Websocket URL to a running Matter Server", - "ws://localhost:5580/ws" + suggestedUrl || "ws://localhost:5580/ws" ); if (!storageUrl) { alert("Unable to connect without URL"); From 34827d4966e6f1615dd539a8dd10d096bae721b0 Mon Sep 17 00:00:00 2001 From: Roman Zipp Date: Sat, 3 Jan 2026 12:37:45 +0100 Subject: [PATCH 2/2] Clear suggested url on connect --- dashboard/src/entrypoint/main.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dashboard/src/entrypoint/main.ts b/dashboard/src/entrypoint/main.ts index ff66212f..df6c6593 100644 --- a/dashboard/src/entrypoint/main.ts +++ b/dashboard/src/entrypoint/main.ts @@ -22,6 +22,10 @@ async function main() { alert("Unable to connect without URL"); return; } + if (suggestedUrl) { + // Remove suggested url from address without redirecting + history.pushState({}, "", window.location.pathname); + } localStorage.setItem("matterURL", storageUrl); } url = storageUrl;