Skip to content

Commit

Permalink
Use hash
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner committed Aug 17, 2023
1 parent 0b20c43 commit e84b7bb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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});
}
Expand Down

0 comments on commit e84b7bb

Please sign in to comment.