-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a warning after a failed connection for brave users
- Loading branch information
1 parent
2b4ba2c
commit 34b6299
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Show, Suspense } from "solid-js"; | ||
|
||
// The Brave browser exports a navigator function to determine whether we are using it. | ||
declare global { | ||
interface Navigator { | ||
brave?: { | ||
isBrave: () => Promise<boolean>; | ||
}; | ||
} | ||
} | ||
|
||
export function BraveWarning() { | ||
const isBrave = (navigator.brave && navigator.brave.isBrave()) || false; | ||
|
||
return ( | ||
<Suspense> | ||
<Show when={isBrave}> | ||
<section class="text-3xl pt-8"> | ||
<h1 class="text-orange-300 font-semibold text-4xl"> | ||
Info: We noticed you are using the Brave browser. | ||
</h1> | ||
<p> | ||
Users have reported that requests to{" "} | ||
<strong>localhost will be blocked</strong> by the{" "} | ||
<strong>Brave browser shield</strong> by default. | ||
</p> | ||
<p> | ||
We have a little section in our docs on how to add an exception to | ||
this rule for <strong>devtools.crabnebula.dev</strong>:{" "} | ||
<a href="https://docs.crabnebula.dev/devtools/brave-browser"> | ||
docs.crabnebula.dev/devtools/brave-browser | ||
</a> | ||
</p> | ||
</section> | ||
</Show> | ||
</Suspense> | ||
); | ||
} |