From 4c47f522492835ca792daeb06e0720052959a22a Mon Sep 17 00:00:00 2001 From: Eugene Crosser Date: Mon, 23 May 2022 22:23:22 +0200 Subject: [PATCH] allow imei as the document path --- webdemo/index.html | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/webdemo/index.html b/webdemo/index.html index d0af1ac..681ebbf 100644 --- a/webdemo/index.html +++ b/webdemo/index.html @@ -10,10 +10,11 @@ const urlParams = new URLSearchParams(window.location.search); const qimei = urlParams.get("imei"); - const ourl = new URL(window.location); - const wsproto = ourl.protocol === "https" ? "wss" : "ws"; - const wshost = ourl.hostname ? ourl.hostname : "localhost"; - const wsport = ourl.port ? ourl.port : 5049; + const wsproto = window.location.protocol === "https" ? "wss" : "ws"; + const wshost = window.location.hostname ? window.location.hostname + : "localhost"; + const wsport = window.location.port ? window.location.port : 5049; + const limei = window.location.pathname.substring(1) const imeis = new Set(); const locations = new Array(); @@ -47,6 +48,8 @@ tstamp = document.getElementById("tstamp"); if (qimei) { imei.value = qimei; + } else if (limei) { + imei.value = limei; } open_ws(); } -- 2.39.2