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.

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.

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! 😅

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.


A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.