-
-
Notifications
You must be signed in to change notification settings - Fork 917
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PWA notice for unsupported browser (#4120)
* PWA notice for unsupported browser * Upper case browser names * Cleanup
- Loading branch information
1 parent
d649a9c
commit 74e5a36
Showing
3 changed files
with
37 additions
and
1 deletion.
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,33 @@ | ||
export function checkBrowserCompatibility() { | ||
const compatible = "serial" in navigator; | ||
|
||
if (!compatible) { | ||
const errorMessage = "Betaflight app requires Chrome, Chromium, Edge or Vivaldi browser."; | ||
const newDiv = document.createElement("div"); | ||
|
||
$('body') | ||
.empty() | ||
.css({ | ||
"height": "100%", | ||
"display": "grid", | ||
"background-image": "url(../images/osd-bg-1.jpg", | ||
"background-size": "cover", | ||
"background-repeat": "no-repeat", | ||
}) | ||
.append(newDiv); | ||
|
||
$('div') | ||
.append(errorMessage) | ||
.css({ | ||
"font-size": "16px", | ||
"background-color": "var(--surface-200)", | ||
"color": "var(--text)", | ||
"padding": "1rem", | ||
"margin": "auto", | ||
"border-radius": "0.75rem", | ||
"border": "2px solid var(--surface-500)", | ||
}); | ||
|
||
throw new Error("No compatible browser found."); | ||
} | ||
} |
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