Blazor WebAssembly: Link that opens page in new tab causes freeze in original page (in Edge browser)
See original GitHub issueI have noticed for as long as I’ve been using Blazor WebAssembly (on .NET 5) that a simple link such as:-
<a href="https://www.microsoft.com" target="_blank">Microsoft</a>
can cause the originating page to become unusable. This happens in Chrome and Edge, but not (yet) FireFox.
Today I tried to repro in a brand new Blazor WebAssembly project, and got instant success.
To reproduce I did this:-
- Use Visual Studio 2019 Pro 16.8.3 on Windows 10
- Create new Blazor WebAssembly project (hosted by ASP.NET Core)
- Edit the Server project properties and select .NET 5 (although 3.1 also has the failure)
- Edit the
Index.razor
page in the Client project - Add
<a href="https://www.microsoft.com" target="_blank">Microsoft</a>
to the bottom of the Index page - Run the app in Chrome or Edge
- Click on
Microsoft
(i.e. the link we added above) - Observe that the Microsoft home page has loaded in a new tab (and that tab has the input focus and is the currently displayed tab)
- Click on the original tab to go back to the Blazor app
- Sometimes on doing this, the Blazor app is inoperable. The cursor can move around, but the cursor is stuck on the “hand pointer” and clicking on links and controls does nothing!
When the original page seizes up like this, you can unfreeze it by opening and closing the Dev Tools window (e.g. tap F12 twice).
Points to note:-
- It only happens sometimes. It may take three or four goes before you witness the problem.
- It only seems to happen in Chromium browsers.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:15 (4 by maintainers)
Top Results From Across the Web
Open External URL in new tab from Blazor WASM
Update: the UI actually only remains frozen for 30-60 seconds following opening a new tab and does eventually become responsive again. So it's ......
Read more >Blazor Open a page in a new Browser tab using navigation ...
Could please advise me the way of open a page in new tab using Navigation manager and how to show pdf file in...
Read more >Edge Stutters and lags really badly when opening a new ...
Edge Stutters and lags really badly when opening a new tab, and sometimes when typing. Edge freezes for like 3 secs and stutters...
Read more >Opening New Tab in Blazor App Not Behaving as Expected
Because the page already had /folder in the URL and I was trying to load the new tab with "folder/mypage", this caused it...
Read more >New Blazor application (any type) hangs in browser with " ...
Click on run, and see the browser (Edge) open (after the build seems to complete inside Visual Studio). Inside the Edge browser the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@SteveSandersonMS - some 8 months on since first reporting this issue, I went back to the web app in question (I’m now working full time on my second major Blazor WebAssembly web app, which doesn’t open pages in new tabs) and tested out the issue quite heavily on both Chrome and Edge. To be clear: this is with VS 2019 running with debugging enabled (i.e. hit F5).
Before testing I updated the
Microsoft.AspNetCore.Components.WebAssembly.*
packages to 5.0.8The result is that I couldn’t reproduce the issue! Which is good.
What I did find is that after opening 10 or so extra tabs (alongside the website’s original page), on closing the browser it could take VS 2019 Pro 16.10.4 some while to return to its normal, I’m-not-debugging-anymore state (10+ seconds). But that’s not a hardship.
So it looks like this issue might/possibly/probably have got fixed somewhere down the line, what with 8 months of updates to Chromium, the Blazor packages and VS itself.
I am happy for this issue to be closed if would like to.
@Andrew-Webb thanks for contacting us.
We believe this is an existing issue that has to do with Blazor debugging. Our recommendation if you are impacted by this is to run without debugging enabled as much as possible.