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.