feature: the beginnings of chat working

This commit is contained in:
Andy Burke 2025-07-01 15:37:35 -07:00
parent 85024c6e62
commit 649ff432bb
24 changed files with 1555 additions and 918 deletions

View file

@ -0,0 +1,22 @@
// https://stackoverflow.com/questions/6390341/how-to-detect-if-url-has-changed-after-hash-in-javascript
(() => {
let oldPushState = history.pushState;
history.pushState = function pushState() {
let ret = oldPushState.apply(this, arguments);
window.dispatchEvent(new Event("pushstate"));
window.dispatchEvent(new Event("locationchange"));
return ret;
};
let oldReplaceState = history.replaceState;
history.replaceState = function replaceState() {
let ret = oldReplaceState.apply(this, arguments);
window.dispatchEvent(new Event("replacestate"));
window.dispatchEvent(new Event("locationchange"));
return ret;
};
window.addEventListener("popstate", () => {
window.dispatchEvent(new Event("locationchange"));
});
})();