Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iframe navigation affecting window history #562

Open
microbit-matt-hillsdon opened this issue Dec 4, 2024 · 0 comments
Open

iframe navigation affecting window history #562

microbit-matt-hillsdon opened this issue Dec 4, 2024 · 0 comments

Comments

@microbit-matt-hillsdon
Copy link

After navigating to micro:bit CreateAI and allowing the page to load, pressing the browser back button once appears to do nothing.

We've tracked this as far as navigations that occur in iframes also affect the parent's window.history. On load, there is a navigation inside the MakeCode iframe, presumably when we initialise a project.

The first back press is trying to undo this navigation, but fortunately, this seems to have no impact on MakeCode.

It is not clear how to fix this and it will need some thought. Manually messing with window.history can go badly. Ideally, we'd want MakeCode's initial navigation to be replaceState rather than pushState.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant