More Safari weirdness cope

be518d3668751edf2a9f676a5ce08f3bc9874bb3

Cohee <18619528+Cohee1207@users.noreply.github.com>

3 files changed, +14 -6Ignore whitespace
public/css/popup-safari-fix.css+5 -1
@@ -1,5 +1,9 @@
11/* iPhone copium land */
22body.iossafari .popup .popup-body:has(.maximized_textarea) {
3+ height: 100%;
4+}
5+
6+body.safari .popup .popup-body {
37 height: fit-content;
48 max-height: 90vh;
59 max-height: 90svh;
public/scripts/RossAscends-mods.js+8 -4
@@ -725,10 +725,14 @@ export function initRossMods() {
725725 RA_autoconnect();
726726 }
727727
728- const isAppleDevice = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
728+ const userAgent = getParsedUA();
729-
729+ console.debug('User Agent', userAgent);
730- if (getParsedUA()?.os?.name === 'iOS' || isAppleDevice) {
730+ const isMobileSafari = /iPad|iPhone|iPod/.test(navigator.platform) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
731- document.body.classList.add('ios');
731+ const isDesktopSafari = userAgent?.browser?.name === 'Safari' && userAgent?.platform?.type === 'desktop';
732+ const isIOS = userAgent?.os?.name === 'iOS';
733+
734+ if (isIOS || isMobileSafari || isDesktopSafari) {
735+ document.body.classList.add('safari');
732736 }
733737
734738 $('#main_api').change(function () {
public/scripts/chats.js+1 -1
@@ -1430,7 +1430,7 @@ jQuery(function () {
14301430 wrapper.classList.add('flexFlowColumn', 'justifyCenter', 'alignitemscenter');
14311431 const textarea = document.createElement('textarea');
14321432 textarea.value = String(bro.val());
14331433 textarea.classList.add('height100p', 'wide100p', 'maximized_textarea');
14341434 bro.hasClass('monospace') && textarea.classList.add('monospace');
14351435 textarea.addEventListener('input', function () {
14361436 bro.val(textarea.value).trigger('input');