linuxserver / emulatorjs

Self hosted web based retro emulation front end with rom and art management.
409 stars 31 forks source link

Chrome Mobile no longer working #131

Closed dimmujed closed 8 months ago

dimmujed commented 8 months ago

A recent update has broken games loading on Chrome mobile on iOS.

When picking a game it loads a black screens with on screen touch buttons but the games never load.

Safari seems to be working, but after selecting a game there's a load button in the middle of the screen you have to select for the game to actually load.

A second issue is my GBA was saying that no games were there until I loaded the back end and clicked add again under gba. They were still green and on the left side as if they should have been there.

thelamer commented 8 months ago

Despite the decorations safari and Chrome on iOS are the same thing. I only test on Safari on an old iPad and do not do agent string checks for chrome variations. The load button is needed in iOS to ensure the audiocontext starts properly all audio playbacks need to be walled behind a specific user clicked button in webkit within the same function.

The frontend reads the raw json that is in the /data/ directory in the container (specifically in your case /data/config/gba.json), the container does not modify this data unless instructed to, in fact the entire frontend once configured can be hosted from object storage or any generic webserver if you choose to , the backend just helps building the website basically.

dimmujed commented 8 months ago

I did know that about Safari and Chrome, but either way for myself and 2 other people in my household are experiencing the same issue after a recent update. Very odd.

thelamer commented 8 months ago

Understood, it is just very difficult for me to reproduce something like this and I need to be able to reproduce it to fix it. I personally test upgrades to the container locally and have never had an issue with files being modified or corrupted in the /data/ directory. The most likely culprit is some kind of browser side cache, next time you see something like this try a private window and see if it still happens. Keep in mind basically the entirety of what is happening with this application is clientside the emulatorjs application just builds the static files for the website and when you are playing anything it is happening inside of your web browser via webassembly.

I have thought about the safari vs WKWebView wrapper apps modifying their client strings and honestly I think the best bet on any apple device will be to always use Safari. So chromium based browsers on all other platforms and Safari on iOS is what I have the bandwidth to test and support. The problem with web browsers in the iOS ecosystem is they actually get a slightly crippled version of safari (WKWebView) stuff like web workers and access to the webcam was not even available until very recently. This is intentional on Apples part, on other platforms alternative web browsers offer some kind of advantage but on iOS it is the exact opposite and you will almost always be better off using Safari directly.

noah82 commented 8 months ago

I'm having this same issue both in the Tesla web browser as well as my iPhone 15 Pro Chrome web browser. SNES games seem to work perfectly, but NES games just hang on the black screen. Just started happening a couple of weeks ago.

thelamer commented 8 months ago

This is the detection I do, I only have an iPad and I do not have an apple id so the damn thing doesn't even let me install apps. https://github.com/linuxserver/emulatorjs/blob/master/frontend/js/libretro.js#L46 I welcome a functioning PR and just in general it would be nice if the videos auto play worked better on iOS. I refer back to my previous comments about safari, if you want to use this frontend use safari.

thelamer commented 8 months ago

Just to be clear here the method of using this application on iOS I recommend and will be available on all Apple devices is to add the site to your home screen via Safari. Just click the share icon when on the page and select "Add to Home Screen". Do not use WKWebView apps like Chrome or other derivatives. as they will never be tested.