Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Does not run on mobile (iOS/Safari-13) #11

Closed
spoofzu opened this issue Apr 17, 2020 · 6 comments
Closed

Does not run on mobile (iOS/Safari-13) #11

spoofzu opened this issue Apr 17, 2020 · 6 comments

Comments

@spoofzu
Copy link

spoofzu commented Apr 17, 2020

Any idea why this might not run on iPhone (version 13.3.1)? I thought it was my JS script but I tried your page, mntn-dev.github.io/t.js, and noticed the same behavior. Locked cursor that does not move. Runs great with desktop browsers, good job btw.

I Realize you have better ways to spend your time but if you could share a couple ideas for me to pursue that would be great. Thanks.

@spoofzu
Copy link
Author

spoofzu commented Apr 17, 2020

A few updates. Does not work with MAC OSX Safari Version 13.0.5 (15608.5.11). Generally works well with desktop version of FF and Chrome. A head scratcher. Well that's JS. ;o)

@mntn-dev
Copy link
Owner

mntn-dev commented Apr 19, 2020

hi,

since Apple doesn't provide (recent) Windows versions of their Safari browser anymore, i can't tinker well. anything the Web Inspector says? (error logs, ...)

does demo.htm also fail? have you tried both, beep:false and beep:true?

@mntn-dev mntn-dev changed the title Does not run on mobile Does not run on mobile (Apple/Safari-13) Apr 20, 2020
@mntn-dev
Copy link
Owner

please check t-debug.htm --

t-debug

@mntn-dev
Copy link
Owner

mntn-dev commented Apr 20, 2020

ok, did some tests at Appertize - looks like a WebAudio/iOS13-related browser issue (also mentioned here and there).

silent/beep-less typing (check t-debug.htm?beep0) should work/run.


meanwhile... skip beep for iOS 13.3 w/ mobile-detect.js:

<script src="https://cdn.jsdelivr.net/npm/mobile-detect@1.4.4/mobile-detect.min.js"></script>

var md=new MobileDetect(window.navigator.userAgent);

$(function(){
 $(elm).t({
  beep:((/13\.3/.test(md.version('iOS')))?false:true)
  //[...]
 });
});

@mntn-dev mntn-dev changed the title Does not run on mobile (Apple/Safari-13) Does not run on mobile (iOS/Safari-13) Apr 20, 2020
@spoofzu
Copy link
Author

spoofzu commented Apr 21, 2020

That was it. Turned off the sound, Success! Appreciate the tips/workaround.

A bonus question, not a show stopper or problem with t.js but I'll ask since your know your JS well. I have the terminal running in a page. Is there an easy way to know when the script execution is complete for the page? Events like on page load are useless. Setting a boolean in the script at the bottom of the page does not work since script sections execute asynchronous will all the other scripts on the same page. The reason I ask is that I start a timer and call,
window.scrollTo(0,document.body.scrollHeight);
every 250ms to scroll the page to the bottom, so the page can be viewed as it's typed. If the answer does not come easy or your don't understand my question don't worry about it. Appreciate your assistance.

@mntn-dev
Copy link
Owner

mntn-dev commented Apr 22, 2020

[...] when the script execution is complete [...]

i recommend to set the to-type-content's CSS to display:none (or visibility:hidden) which avoids flashing while page/script-loads is active.

btw, i recommend bottom:0 for the (to-type-)container's CSS, or, capturing a newline via t.js' typing callback and exec .scrollTop then.

see:

@spoofzu spoofzu closed this as completed Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants