xpine 0.0.39 → 0.0.40
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 +6 -3
- package/package.json +1 -1
package/dist/src/static/spa.js
CHANGED
|
@@ -169,17 +169,20 @@ function replaceAttributesOnDocumentBody(dom) {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
async function handleBackButton() {
|
|
172
|
+
const url = window.history.state?.targetHref || window.location.href;
|
|
172
173
|
const initEvent = new CustomEvent("spa-popstate-initiated", {
|
|
173
174
|
detail: {
|
|
174
|
-
href:
|
|
175
|
+
href: url,
|
|
176
|
+
url: safeParseURL(url)
|
|
175
177
|
}
|
|
176
178
|
});
|
|
177
179
|
window.dispatchEvent(initEvent);
|
|
178
180
|
if (window.xpineIgnorePopState) return;
|
|
179
|
-
await getNewPageContent(
|
|
181
|
+
await getNewPageContent(url);
|
|
180
182
|
const updatedEvent = new CustomEvent("spa-popstate-updated", {
|
|
181
183
|
detail: {
|
|
182
|
-
href:
|
|
184
|
+
href: url,
|
|
185
|
+
url: safeParseURL(url)
|
|
183
186
|
}
|
|
184
187
|
});
|
|
185
188
|
window.dispatchEvent(updatedEvent);
|