Skip to content

Commit 60be226

Browse files
feat: add safari not support modal (#310)
* wip: add safari not support modal * feat: add link to docs * fix: safari not supported docs url * fix: shorten url and word break * fix: add emphasize on docs url * fix: update link to docs
1 parent 2b4ba2c commit 60be226

2 files changed

Lines changed: 37 additions & 1 deletion

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Dialog } from "~/base-components/dialog";
2+
import { AlertDialog } from "@kobalte/core";
3+
4+
export function SafariNotSupportedDialog() {
5+
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);
6+
7+
return (
8+
<Dialog
9+
title="Safari is not supported"
10+
buttons={
11+
<AlertDialog.CloseButton class="border border-neutral-400 hover:bg-neutral-800 hover:border-neutral-100 text-white text-lg py-2 px-4 rounded focus:outline-dashed focus:outline-white focus:outline-offset-2">
12+
Dismiss
13+
</AlertDialog.CloseButton>
14+
}
15+
defaultOpen={isSafari}
16+
>
17+
<p>
18+
DevTools Web currently does not support the use of Safari. Sadly Safari
19+
does not allow you to make requests to localhost. More information in
20+
our docs:{" "}
21+
<strong>
22+
<a
23+
class="break-words underline"
24+
href="https://docs.crabnebula.dev/devtools/troubleshoot/broken-connection/#safari-not-supported"
25+
>
26+
docs.crabnebula.dev/devtools/troubleshoot/broken-connection/#safari-not-supported
27+
</a>
28+
</strong>
29+
</p>
30+
</Dialog>
31+
);
32+
}

clients/web/src/views/connect.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ import { checkConnection } from "~/lib/connection/transport";
77
import { GithubIcon } from "~/components/icons/github";
88
import { ConnectionFailedDialog } from "~/components/dialogs/connection-failed-dialog";
99
import { createStore } from "solid-js/store";
10-
import { createSignal } from "solid-js";
10+
import { createSignal, DEV, Show } from "solid-js";
11+
import { SafariNotSupportedDialog } from "~/components/dialogs/safari-not-supported-dialog";
1112

1213
export default function Connect() {
1314
const navigate = useNavigate();
@@ -134,6 +135,9 @@ export default function Connect() {
134135
port={connectionStore.port}
135136
retry={tryToConnect}
136137
/>
138+
<Show when={!DEV}>
139+
<SafariNotSupportedDialog />
140+
</Show>
137141
</div>
138142
);
139143
}

0 commit comments

Comments
 (0)