MicrosoftEdge / MicrosoftEdge/WebView2Feedback

Mutiple webview in wpf TabControl, only first (visible) will load

Open
#3,818 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description
I want to load mutiple webpages at same time, so I add a TabControl and Bind a WebView2 control for each TabItem.
When window loaded, only the first tab loaded with DocumentTitleChanged,FaviconChanged events fired.
The other tabs only load after the tab was clicked.

Demo:
You can see the title will only update after tab was activated. ( The icons was get from some public service based on url, not from webview)

https://github.com/MicrosoftEdge/WebView2Feedback/assets/1972649/9f54d27c-d038-4efd-8056-74a2d9af3aff

I know this maybe a design decision, wish there is some option to allow loading content without make webview visible or some other ways to get title and icon of the webpage before activating the tabs.

Version
SDK: 1.0.1938.49
Runtime: 117.0.2045.36
Framework: WPF
OS: Win11

Regression
Was this working before but has regressed? No
If yes, what version did this last work on?

Repro Steps
Binding WebView control into TabItem's Content.

<TabControl.ContentTemplate>
    <DataTemplate>
        <ContentControl Margin="0" Content="{Binding WebView}" />
    </DataTemplate>
</TabControl.ContentTemplate>

Screenshots

Additional context

https://weblog.west-wind.com/posts/2022/Jul/14/Fighting-WebView2-Visibility-on-Initialization

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the WPF TabControl.ContentTemplate repro and the linked discussion about WebView2 visibility during initialization. Determine whether WebView2 supports loading hidden tab contents or whether an alternative title and favicon retrieval path is needed; done means documenting or enabling a supported way to populate inactive tabs before activation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.