iOS Safari fails to lockdown (with potential fix)
See original GitHub issue- Call
lockdown()
on the latest version of iOS Safari - Lockdown fails with the error
Cannot read "configurable" of undefined
in the console
Digging in a bit, I found that the error is caused inside isImmuatableDataProperty()
:
function isImmutableDataProperty(obj, name) {
const desc = getOwnPropertyDescriptor(obj, name)
return (
//
// The getters will not have .writable, don't let the falsyness of
// 'undefined' trick us: test with === false, not ! . However descriptors
// inherit from the (potentially poisoned) global object, so we might see
// extra properties which weren't really there. Accessor properties have
// 'get/set/enumerable/configurable', while data properties have
// 'value/writable/enumerable/configurable'.
desc.configurable === false &&
desc.writable === false &&
//
// Checks for data properties because they're the only ones we can
// optimize (accessors are most likely non-constant). Descriptors can't
// can't have accessors and value properties at the same time, therefore
// this check is sufficient. Using explicit own property deal with the
// case where Object.prototype has been poisoned.
objectHasOwnProperty(desc, 'value')
)
}
It is called with isImmutableDataProperty(window, 'showModalDialog')
, which in iOS safari is actually undefined.
So when it tries to get the property descriptor, desc
is also undefined.
I added a hack to return true if desc
is undefined and everything seems to work as expected.
I’m not sure if that is the actual fix though.
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (12 by maintainers)
Top Results From Across the Web
About Lockdown Mode - Apple Support
On Mac · From the menu bar in Safari, choose the Safari menu > Settings. · Click Websites. · In the sidebar, scroll...
Read more >Hands-on with Lockdown Mode in iOS 16 - TechCrunch
Safari says “Lockdown Mode” when the feature is switched on. You can see that TechCrunch loads fairly well and that the browser relies...
Read more >Orion Does Not Show Up on List of Apps in Lockdown Mode ...
There is no way to exclude websites from Lockdown Mode (as there is in Safari). A quick search on https:/developer.apple.com doesn't reveal much ......
Read more >Unable to open links in Safari, Mail or Messages on iOS 9.3
Short version: there is currently no fix for this – we're waiting on Apple to resolve. A reboot sometimes temporarily fixes the issue,...
Read more >Safe Exam Browser - News
Fix for "Back to Safari" button/link function in visible Status Bar on iOS 14 before 14.5 in AAC kiosk mode. Optional features, which...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Apparently fixed: https://bugs.webkit.org/show_bug.cgi?id=234282 !
@mhofman nope 😕 sorry.