/* ============================================================ ARP Academy — Squarespace Editor Kill Switch (HEADER) v1.0 Put this in Squarespace SETTINGS → Advanced → Code Injection → HEADER ABOVE the Memberstack embed snippet. Purpose: prevent redirect logic while editing in Squarespace (iframe preview). ============================================================ */ (function () { var inIframe = false; try { inIframe = (window.self !== window.top); } catch (e) { inIframe = true; } var ref = (document.referrer || "").toLowerCase(); var isSquarespaceEditorRef = ref.indexOf("squarespace.com") !== -1 && (ref.indexOf("/config") !== -1 || ref.indexOf("/cms") !== -1); // Only activate inside Squarespace editor preview if (!inIframe && !isSquarespaceEditorRef) return; // Global flag used by footer scripts window.__ARP_SQS_EDITOR__ = true; window.__ARP_DISABLE_ACADEMY_AUTOROUTE__ = true; // Block redirects inside the editor iframe (so you can edit pages) try { var _replace = window.location.replace.bind(window.location); var _assign = window.location.assign.bind(window.location); window.location.replace = function () { /* blocked in editor */ }; window.location.assign = function () { /* blocked in editor */ }; // Expose originals if you ever need them in console window.__ARP_LOC_ORIG__ = { replace: _replace, assign: _assign }; } catch (e) {} })();