-
Notifications
You must be signed in to change notification settings - Fork 10k
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
Using an iframe with a dynamic source breaks the back button in firefox (blazor server) #21002
Comments
@Trolldemorted thanks for contacting us. I'm not sure why it is exposing that behavior, but it seems that the app is crashing in some way by what you describe and these lines of code probably need some error handling:
I would ask what are you trying to achieve to see if we can offer you alternative ways to accomplish the same result. |
In my production use case the Why do you think the app is crashing? It continues to work just fine - No exceptions in VS debug output, no errors in firefox' console, I can click around, my handlers are being executed correctly, I can navigate between pages, the only problem is the back button, and only in firefox. Since pressing the back button twice fast enough works (the first button reloads the page, the second press must come before the iframe loads), I assumed that blazor incorrectly pushes a new state to the browser's history when the iframe src is modified in an InvokeAsync block. |
@Trolldemorted, it seems that the usage of On a side note, do you see the same behavior if Blazor out of picture - if you add same HTML structure in a new html page, will the back button be disabled again? |
I am using Task.Run to have the database access running in a thread without a synchronization context. Are you certain you don't want to fix this bug nevertheless? The back button is not disabled, it just refers to the same page which pushes a new state as soon as the iframe loads. Using a normal iframe does not impair firefox' history. |
Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue. This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue! |
Describe the bug
Having an iframe where the
src
attribute is modified within anInvokeAsync
block impairs the "One Page Back"-button experience: If you click the button in firefox (75.0), the iframe appears to reload, but you are not redirected to the previous page.In Edge and Chrome it works fine. In IE11 my sample throws an
ObjectDisposedException
, which is most likely a different bug I guess?To Reproduce
Either clone this repo, or use this snippet:
Open firefox and the index page, click on "iframe" to navigate to
/i/iframe
, wait for iframepage and the actual iframe to load, press the back button once, and you will see that your browser does not navigate to the previous page.Further technical details
3.1.3
dotnet --info
Microsoft Visual Studio Enterprise 2019 Version 16.5.4
The text was updated successfully, but these errors were encountered: