Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: safari support #24

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/looking-glass-bridge.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/looking-glass-bridge.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/looking-glass-bridge.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class lt {
if (!ot())
return { success: !1 };
let s = this;
return this.ws = new WebSocket("ws://localhost:9724/event_source"), new Promise((r) => {
return this.ws = new WebSocket("ws://127.0.0.1:9724/event_source"), new Promise((r) => {
this.ws !== void 0 && (this.ws.onopen = () => {
var l;
N.getInstance().log("%c Connected to Websocket ", "color: chartreuse; font-weight: bold; border: solid");
Expand Down Expand Up @@ -3556,10 +3556,10 @@ const T = class {
const e = new Promise((t) => {
let s = setTimeout(() => {
clearTimeout(s), t(new Error("Timed out"));
}, 5e3);
}, 1e3);
});
try {
const t = await Promise.race([fetch("http://localhost:33334/"), e]);
const t = await Promise.race([fetch("http://127.0.0.1:33334/"), e]);
if (!t.ok)
throw new Error(`HTTP error! status: ${t.status}`);
return !0;
Expand Down
2 changes: 1 addition & 1 deletion dist/looking-glass-bridge.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/library/client/BridgeClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,11 @@ export class BridgeClient {
let id = setTimeout(() => {
clearTimeout(id)
reject(new Error("Timed out"))
}, 5000)
}, 1000)
})

try {
const response = (await Promise.race([fetch("http://localhost:33334/"), timeout])) as Response
const response = (await Promise.race([fetch("http://127.0.0.1:33334/"), timeout])) as Response
if (!response.ok) {
throw new Error(`HTTP error! status: ${response.status}`)
}
Expand Down
2 changes: 1 addition & 1 deletion src/library/components/eventsource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class BridgeEventSource {
if (!isWebSocketAvailable()) return { success: false }
let bridgeEventSource = this
// provided we have web socket support, we can proceed to query Bridge
this.ws = new WebSocket("ws://localhost:9724/event_source")
this.ws = new WebSocket("ws://127.0.0.1:9724/event_source")

return new Promise((resolve) => {
if (this.ws !== undefined) {
Expand Down