@contentstack/live-preview-utils
Version:
Contentstack provides the Live Preview SDK to establish a communication channel between the various Contentstack SDKs and your website, transmitting live changes to the preview pane.
24 lines (23 loc) • 503 B
JavaScript
import "../chunk-5WRI5ZAA.js";
// src/utils/handlePageTraversal.ts
var handlePageTraversal = () => {
window.addEventListener("unload", () => {
const targetURL = document.activeElement.href;
if (targetURL) {
window.parent.postMessage(
{
from: "live-preview",
type: "url-change",
data: {
targetURL
}
},
"*"
);
}
});
};
export {
handlePageTraversal
};
//# sourceMappingURL=handlePageTraversal.js.map