-
Notifications
You must be signed in to change notification settings - Fork 55
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]: FrameCreated event sometimes doesn't fire for nested iframes #5115
Comments
Hi @pushkin-, Could you try using the alternative: Consider using the NestedFrameCreated event handler in CoreWebView2. This event will fire for all nested frame created events on CoreWebView2. You can subscribe to the CoreWebView2::NestedFrameCreated event to track all nested frames. Example:
Please let us know, if this works for you. |
What is |
@pushkin- I used exact same steps, and for me it is hitting the breakpoint, which means I see that it is sending Frame created for myFrame as well... I have used winforms app only... COuld yop please provide more details if there is any other change you have made to the app? |
WebView2WindowsFormsBrowser_FrameCreatedIssue.zip huh - I don't believe I modified anything else. I uploaded the exact sample app I used above to repro this issue. Other people on my team are also able to repro. Maybe give that one a shot. @krbharadwaj |
@pushkin- Apologies for missing out on the details... I tried adding the iframe not replacing earlier... Looking at the details of the issue it seems, your concerns is that for inner frames creation we are not getting framecreated event... to check that, I tried adding below html: With below app code :
And with this, breakpoint is hitting both of the breakHere statements... |
What happened?
I'm seeing this issue in my app maybe 40-50% of the time, but in the WebView2 sample, I see it 100% of the time.
This might be specific to this website, but I'm seeing cases where
FrameCreated
isn't firing for a nested iframe.For my general usecase, I haven't seen this problem, but since I don't know if this could start happening for the page I load in iframes, I'm marking this as Important out of caution. If we determine that this happens because of this specific site, then we can mark this Low.
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Prerelease (Edge Canary/Dev/Beta)
Runtime Version
135.0.3146.0 canary
SDK Version
1.0.3116 pre-release
Framework
Winforms
Operating System
Windows 11
OS Version
24H2 OS Build 26100.2894
Repro steps
Setup:
WebView_HandleIFrames
with:breakHere
variableRepro steps:
<iframe src="https://example.com" name="myFrame"></iframe>
Alternatively, if you open devtools on that page and run this code:
const a = document.createElement("iframe"); a.name = "myFrame"; a.src = "https://example.com"; document.body.appendChild(a);
, then the breakpoint will get hit.Like I said above, in my app, I see this roughly half the time, but can repro every time in the webview2 sample app. Maybe some kind of race condition?
Notably, this page creates a ton of iframes. Maybe this doesn't repro with a simpler page.
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
The text was updated successfully, but these errors were encountered: