Detect a SFSafariViewController vs Safari Browser with Javascript

Hello!

We are looking for a way to detect if the user is in a SFSafariViewController or Safari Browser using Javascript. I was hoping for something in the window object, but there's nothing.

I know some people have used window.innerHeight to do this for iOS versions up to iOS 14... but this does not work for iOS 15 & 16. And the only thing I could find on any forums are people saying that it cannot be done.

I'm hoping that we could get a developer from Apple working on this ASAP, as we need to be able to do this.

Hi there, I wanted to bring up an issue related to the downloading experience in SFSafariViewController, which seems noticeably less user-friendly compared to Safari. It would be incredibly helpful if the downloading UX could be improved. In the meantime, could you please provide a way for us to detect when SFSafariViewController is being used, so we can adjust accordingly? Thank you for your attention to this!

Detect a SFSafariViewController vs Safari Browser with Javascript
 
 
Q