MicrosoftEdge / WebView2Feedback

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

[Problem/Bug]: User-Agent Changes not reflected in iFrames #4144

Closed shmuelie closed 6 days ago

shmuelie commented 10 months ago

What happened?

I have a UWP application using WebView2 to load a webpage. We're setting a custom user agent so sites know that we're loading them. The sites have iFrames and pages in the iFrame are not seeing the changed user agent, only the root page does.

Importance

Blocking. My app's basic functions are not working due to this issue.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

No response

SDK Version

1.0.2151.40

Framework

WinUI2/UWP

Operating System

Windows 10, Windows 11

OS Version

No response

Repro steps

Regression

No, this never worked

Last working version (if regression)

No response

AB#47503437

vbryh-msft commented 10 months ago

It reproes for cross origin iframes, not same origin ones - is it correct? Also what are the expectations for iframes level - it is first level iframes or you need nested also?

shmuelie commented 10 months ago

Ah yes, for cross origin iframes. And we would want the user agent changed for all frames, no matter how nested

ynborokh commented 9 months ago

I observe the same issue for WinUI 3 (WebView2 runtime 119.0.2151.72). Is it a bug?

yildirimcagri-msft commented 4 months ago

We have a fix for this that is currently available in latest Canary Runtime. Please let us know if you still run into this in Canary.

champnic commented 6 days ago

Fixed in 126.0.2584.0+. Thanks!