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

[Problem/Bug]: Synchronizing Tab States with Extension Scripts in a Multi-tab Browser Developed with C# WebView2 #4607

Open
atfeel opened this issue Jun 2, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@atfeel
Copy link

atfeel commented Jun 2, 2024

What happened?

I have developed a multi-tab browser using C# WebView2. For each new tab created, a WebView2 instance is instantiated. Suppose I created 3 instances. In the extension script, I use:

chrome.tabs.query({active: true}, function(tabs) {
console.log(tabs);
});

to query the current active tab. Normally, it should only return the information of the active tab object, but the problem is that after executing the query, it returns 3 tab information entries that correspond to the previous 3 WebView2 instances, and all objects have the active property set to true, which is obviously incorrect.
image

Is this a bug in WebView2? Could anyone please help analyze this? Thank you very much.

I hope that when a new WebView2 instance is created, the display state of the WebView2 instance can be synchronized within the extension environment. The version of WebView2 I am using is 1.0.2535.41.

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

1.0.2535.41

SDK Version

No response

Framework

WPF

Operating System

Windows 10

OS Version

No response

Repro steps

As long as multiple instances are created in C#, no matter which instance is visible, when querying through the extension script with:
chrome.tabs.query({active: true}, function(tabs) {
console.log(tabs);
});

it returns all instances and all of them have active set to true.
image

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

@atfeel atfeel added the bug Something isn't working label Jun 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant