Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

nested iframe postmessage don't fired the message event

Post Reply
312684696
Posts: 11
Joined: Wed Jun 08, 2022 3:38 am

nested iframe postmessage don't fired the message event

Post by 312684696 »

1.png
in my page,an iframe named "cframe" in a parent iframe named "pframe".
pframe postmessage fired the OnFrameWebMsgRec event.
but the cframe didn't;

Code: Select all

WVBrowser1FrameCreated
....
var
  TempArgs: TCoreWebView2FrameCreatedEventArgs;
  TempFrame: TCoreWebView2Frame;
begin
  TempArgs := TCoreWebView2FrameCreatedEventArgs.Create(aArgs);
  Inc(FFrameIndex);
  TempFrame := TCoreWebView2Frame.Create(TempArgs.Frame, FFrameIndex);
  try
    TempFrame.AddAllBrowserEvents(WVBrowser1);
    Fframes.Add(FFrameIndex, TempFrame);
  finally
    TempArgs.Free;
  end;
  
by above code ,the cframe's FrameIndex is 1,the pframe's FrameIndex is 2.
You do not have the required permissions to view the files attached to this post.
User avatar
salvadordf
Posts: 4121
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: nested iframe postmessage don't fired the message event

Post by salvadordf »

Hi,

That's unexpected. If that event works for the parent frame it should also work for the child frame.
This might be an issue in the WebView2 framework.

Please, report this issue in the WebView2Feedback repository :
https://github.com/MicrosoftEdge/WebView2Feedback
312684696
Posts: 11
Joined: Wed Jun 08, 2022 3:38 am

Re: nested iframe postmessage don't fired the message event

Post by 312684696 »

Thx, I'll give it a try
User avatar
salvadordf
Posts: 4121
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: nested iframe postmessage don't fired the message event

Post by salvadordf »

For anyone interested in this issue, these are the links to the feedback repository :
https://github.com/MicrosoftEdge/WebView2Feedback/issues/2836
https://github.com/MicrosoftEdge/WebView2Feedback/issues/2440

This feature is not supported right now but it's on their backlog.
312684696
Posts: 11
Joined: Wed Jun 08, 2022 3:38 am

Re: nested iframe postmessage don't fired the message event

Post by 312684696 »

thank you
Post Reply