Skip to content

Commit

Permalink
[FEATURE] Add browser detection to disallow splash screen use for Saf…
Browse files Browse the repository at this point in the history
…ari and Firefox (not working currently) #354
  • Loading branch information
vicwomg committed Aug 28, 2024
1 parent b580fee commit 865ed56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion pikaraoke/templates/splash.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
video.readyState > 2
);

const isFirefox = typeof InstallTrigger !== "undefined";
const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);

var mouseTimer = null,
cursorVisible = true;

Expand Down Expand Up @@ -270,6 +273,12 @@
let params = new URLSearchParams(window.location.search);
let dismissConfirmation = params.get("confirm");

if (isFirefox || isSafari) {
confirm(
"This browser is not supported. You may experience streaming issues. Please use Chrome for best results."
);
}

if (dismissConfirmation === "false") {
let modal = document.getElementById("permissions-modal");
modal.classList.remove("is-active");
Expand Down Expand Up @@ -303,7 +312,9 @@

<div id="ap-container">
<div class="is-size-5 stroke">
<div id="hostap">{% for line in hostap_info %}{{ line }}<br />{% endfor %}</div>
<div id="hostap">
{% for line in hostap_info %}{{ line }}<br />{% endfor %}
</div>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion pikaraoke/translations/es_VE/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -559,4 +559,4 @@ msgstr "A continuación:"
#. to the queue.)
#: templates/splash.html:10
msgid "Next singer:"
msgstr "Próximo cantante:"
msgstr "Próximo cantante:"

0 comments on commit 865ed56

Please sign in to comment.