Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

apply polyfill only in iframe

Roman Pominova05abd6031f0
diff --git a/packages/react-sdk/src/tree/session-storage-polyfill.tsx b/packages/react-sdk/src/tree/session-storage-polyfill.tsx
index b3dbe08026..4277f289b1 100644
--- a/packages/react-sdk/src/tree/session-storage-polyfill.tsx
+++ b/packages/react-sdk/src/tree/session-storage-polyfill.tsx
@@ -2,6 +2,11 @@
// The code is based on this discussion https://bugs.chromium.org/p/chromium/issues/detail?id=357625
const polyfill = function () {
+ // run only if we're in an iframe
+ if (window.location === window.parent.location) {
+ return;
+ }
+
try {
const key = "__session_storage_availability_test__";
sessionStorage.setItem(key, "test"); // test