MicrosoftEdge / WebView2Feedback

Feedback and discussions about Microsoft Edge WebView2
https://aka.ms/webview2
444 stars 53 forks source link

Setting DefaultBackgroundColor on WebView2 affects Web add-ins #2856

Open tiagoabreu opened 1 year ago

tiagoabreu commented 1 year ago

Description We have a VSTO add-in that uses WebView2. Setting the DefaultBackgroundColor on the WebView affects any web add-in loaded later.

Version SDK: 1.0.1293.44 Runtime: 105.0.1343.53 Framework: WinForms OS: Win10 21H2

Repro Steps

  1. Install Web add-in that opens a simple page
  2. Run Sample add-in that sets a background color for the WebView (in this case, red)
  3. Verify the task pane created from the Sample add-in is open
  4. Open the Web add-in.
  5. Notice how the background is also red.

image Notice how in the previous image the web add-in is red. That color was set by the VSTO add-in.

We provide a sample vsto add-in for Excel and a sample web-addin where the issue is easily verifiable. The color is set in class Browser.designer.cs, line 38.

ExcelWebAddIn1Manifest.zip SampleAddinWithWebView2.zip

victorthoang commented 1 year ago

@tiagoabreu thank you for your investigation,

@oggy22 will help to investigate this, and we will add it to our backlog to correct.

tiagoabreu commented 1 year ago

@oggy22 Is there any update on this issue?

victorhuangwq commented 8 months ago

@tiagoabreu are you still facing this issue?

tiagoabreu commented 8 months ago

No, because we applied a workaround where we created a background color for the web add-in, so if it happens it would not be noticeable.

But with the repro steps you should be able to figure out if the issue is still there.