From aa8f4b4069550220a3184e733f67e510f27b8100 Mon Sep 17 00:00:00 2001 From: William Mills Date: Wed, 15 Nov 2023 01:42:25 -0600 Subject: [PATCH] Update widget.html --- widget.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/widget.html b/widget.html index 37ea865..8259df9 100644 --- a/widget.html +++ b/widget.html @@ -152,6 +152,7 @@

...

const urlParams = new URLSearchParams(queryString); const username = urlParams.get("username"); const password = urlParams.get("password"); + let ipAddress = urlParams.get("ipAddress"); let connected = false; @@ -159,7 +160,8 @@

...

// Only attempt to connect to the local host if URL parameters are present if (username && password) { - console.log(`Connecting to Device`); + if(!ipAddress) ipAddress = 'localhost'; + console.log(`Connecting to Device`, ipAddress); status.innerHTML = `URL Parameters Found - Connecting to Device`; connectToDevice(); } else {