Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

I've recently installed the 12.1.2 update for Safari and all of a sudden the Online Atari Lynx Emulator I've published stopped working when loading ROMs from the local file system. I've been making some updates to this emulator so figured maybe I screwed something up so tried running my development version, and that had the same problem. After spending hours going through code I couldn't find any issues...then I remembered about that Safari update the day earlier.

What was odd was when I loaded ROMs from a URL, they would run OK. It was only the locally loaded ROMs that would fail. Quite a while back, due to Chrome's Autoplay Blocking, I had to implemented a 'Click to Start' button for URL loaded ROMs. At the time, Safari didn't require that. Now however it seems that Safari is even more strict than Chrome, and Firefox.
safautoplay_2.png


So I knew that it was just a problem for locally loaded ROMs and started to play around with various Preferences. In the end I found that it was the "Auto-Play" setting, "Stop Media with Sound" that was the culprit. Maybe this update has reset it for me, but toggling it from "Stop Media with Sound" to "Allow All Auto-Play" made the emulator work again properly.
safautoplay_1.png




Of course that wasn't a permanent solution. Expecting all website users to have that setting is not reasonable. What I decided to do is take the same approach for both the URL and locally loaded ROMs. That is - require a user to interact with the website first by clicking that "Click to Start" button. It's not ideal but it seems like the only way to make it work reliably.

For this approach the emulator was loaded and its file system were initialised as usual. The ROM was also loaded, but the main method of the WebAssembly module wasn't called until the "Click to Start" button was pressed.

It's still surprising that just drag-and-dropping a ROM works perfectly well in Chrome and Firefox. I guess the act of doing the drag-and-drop is counted as a page interaction in those browsers, just not in Safari. The joy of cross-browser compatibility! 😅
safautoplay_3.png


I'll be writing an article on how I got this emulator to work in the near future. It is based on RetroArch, specifically the Web/Emscripten port of it. There's precious little documentation on that port and I'm still yet to build my own modules from code successfully. When I make better progress, you'll hear about it on this Blog.

-i

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...