Closed
Description
Preconditions
- Magento 2.2.2 but potentially all versions are affected
- Block all cookies setting enabled in Safari privacy options.
Steps to reproduce
- Open Safari browser and go to Preferences
- In Privacy tab enable Block all cookies setting.
- Open any Magento shop.
Expected result
- At least the popup with "cookies disabled" message is being displayed.
Actual result
- There are multiple
SecurityError (DOM Exception 18): The operation is insecure.
errors reported in browser's console, some of the scripts work but I can't add anything to the cart.
So it seems like having above setting enabled in Safari will result in above error every time any script is trying to access either window.localStorage
or window.sessionStorage
including reassigning it. As a result following lines throw errors and most probably prevent shop from functioning properly:
and also this part of https://github.com/magento/magento2/blob/2.2-develop/lib/web/jquery/jquery.storageapi.min.js:
function f(e) {
if (!window[e]) // Error thrown here
return !1;
var t = "jsapi";
try {
return window[e].setItem(t, t), window[e].removeItem(t), !0
} catch (r) {
return !1
}
}
I am not sure what would be your preferred solution to this problem but I can gladly prepare a PR when we agree on how we should solve it 👍 .
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.4-develop branchGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release