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

feat: don't autoblock non-chrome browsers #2096

Merged
Merged
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
11 changes: 7 additions & 4 deletions resources/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,20 @@
localStorage.setItem("day8.re-frame-10x.show-panel","\"true\"")
localStorage.setItem("day8.re-frame-10x.using-trace?","\"true\"")
}
function isBrowserSupported() {
return userAgent.indexOf("chrome/") > -1;
function isBrowserUnsupported() {
var isWebkit = userAgent.indexOf("applewebkit/") > -1;
var isChrome = userAgent.indexOf("chrome/") > -1;
// Chrome also has applewebkit in the useragent, but it is supported.
return isWebkit && !isChrome;
}
function showUnsupportedBrowserWarning() {
let warnDiv = window.document.createElement("div");
warnDiv.innerText = "Only browsers based on Chrome/Chromium are supported";
warnDiv.innerText = "Safari based browsers based are not supported";
window.document.body.appendChild(warnDiv);
}
</script>
<script>
if (!isBrowserSupported()) {
if (isBrowserUnsupported()) {
showUnsupportedBrowserWarning();
} else {
var electron = isElectron()
Expand Down
3 changes: 2 additions & 1 deletion src/cljs/athens/util.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@
[(case os
:windows "os-windows"
:mac "os-mac"
:linux "os-linux")
:linux "os-linux"
"os-linux")
(if electron? "is-electron" "is-web")
(if theme-dark? "is-theme-dark" "is-theme-light")
(when win-focused? "is-focused")
Expand Down