mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
23d683cf6b
Seems like a specification bug, but other browsers update url before popstate event is fired and so should we. Fixes back/forward navigation on GitHub.
11 lines
385 B
HTML
11 lines
385 B
HTML
<script>
|
|
window.history.pushState({}, '', window.location.href + '#test');
|
|
|
|
window.addEventListener('popstate', (e) => {
|
|
const url = new URL(window.location.href);
|
|
const pathWithHash = url.pathname.split('/').pop() + url.hash;
|
|
parent.postMessage(`popstate event from iframe new_path=${pathWithHash}`, '*');
|
|
});
|
|
|
|
window.history.back();
|
|
</script>
|