xpine 0.0.37 → 0.0.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/static/spa.js +7 -0
- package/package.json +1 -1
package/dist/src/static/spa.js
CHANGED
|
@@ -169,7 +169,14 @@ function replaceAttributesOnDocumentBody(dom) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
async function handleBackButton() {
|
|
172
|
+
if (window.xpineIgnorePopState) return;
|
|
172
173
|
await getNewPageContent(window.history.state?.targetHref || window.location.href);
|
|
174
|
+
const event = new CustomEvent("spa-popstate", {
|
|
175
|
+
detail: {
|
|
176
|
+
href: window.history.state?.targetHref || window.location.href
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
window.dispatchEvent(event);
|
|
173
180
|
}
|
|
174
181
|
function isRelativeURL(url) {
|
|
175
182
|
if (typeof url !== "string") return false;
|