From e84b7bbb14480f117099df22c299e6341c62f428 Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Wed, 16 Aug 2023 17:43:09 -0700 Subject: [PATCH] Use hash --- .../UserInterface/Base/BrowserInspectorFrontendHost.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/WebInspectorUI/UserInterface/Base/BrowserInspectorFrontendHost.js b/Source/WebInspectorUI/UserInterface/Base/BrowserInspectorFrontendHost.js index 8358e8dfff010..19ac4942871c0 100644 --- a/Source/WebInspectorUI/UserInterface/Base/BrowserInspectorFrontendHost.js +++ b/Source/WebInspectorUI/UserInterface/Base/BrowserInspectorFrontendHost.js @@ -92,7 +92,7 @@ if (!window.InspectorFrontendHost) { const queryParams = parseQueryString(window.location.search.substring(1)); let url = "ws" in queryParams ? "ws://" + queryParams.ws : null; if (!url) { - url = location.pathname.slice(1); + url = location.hash.slice(1); if (url && (!url.startsWith("ws://") && !url.startsWith("ws://"))) { url = "ws://" + url; } @@ -108,7 +108,8 @@ if (!window.InspectorFrontendHost) { var socket = new WebSocket(url); } catch (e) { if (typeof window.onFailToLoad === "function") { - window.onFailToLoad(url); + window.onFailToLoad(e, url); + return; } throw new Error(`Could not connect to "${url}"`, {cause: e}); }