We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5fca50e commit 29b501aCopy full SHA for 29b501a
app/code/Magento/Theme/view/frontend/requirejs-config.js
@@ -49,3 +49,24 @@ var config = {
49
}
50
51
};
52
+
53
+/* eslint-disable max-depth */
54
+/**
55
+ * Adds polyfills only for browser contexts which prevents bundlers from including them.
56
+ */
57
+if (typeof window !== 'undefined' && window.document) {
58
+ /**
59
+ * Polyfill localStorage and sessionStorage for browsers that do not support them.
60
61
+ try {
62
+ if (!window.localStorage || !window.sessionStorage) {
63
+ throw new Error();
64
+ }
65
66
+ localStorage.setItem('storage_test', 1);
67
+ localStorage.removeItem('storage_test');
68
+ } catch (e) {
69
+ config.deps.push('mage/polyfill');
70
71
+}
72
+/* eslint-enable max-depth */
0 commit comments