Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if ios safari/chrome is in lockdown mode for a ReactJS Webapp

As per the title, how would I check the safari/chrome browser used by an iphone/ios user is in lock down mode?

I've got a web app which works fine, but recently when testing on ios 17.2 indexedDB doesn't work, I cannot add files, it just crashes with no error message. so I assume its in lockdown mode. I did do a test on browserstack with the same ios version in safari and it worked without issue, any help would be appericated.

Resources I've looked at:

  • https://forums.developer.apple.com/forums/thread/710176
  • Swift code let isLockdownModeEnabled = (UserDefaults.standard.object(forKey: "LDMGlobalEnabled") as? Bool) ?? false however I cant access UserDefaults via javascript
like image 558
Dean Van Greunen Avatar asked Oct 16 '25 20:10

Dean Van Greunen


1 Answers

I'm using this:

if (typeof window.FileReader === 'undefined')
{
     alert('Do you have Lockdown Mode enabled on your device?\n\nIf so you will need to add our website to the list of allowed sites to continue.');
}

Any false negatives or positives observed for this would be appreciated.

like image 155
Simon_Weaver Avatar answered Oct 19 '25 10:10

Simon_Weaver



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!