cefglue - custom popup - how to set opener_window_handle ?

Having problems with building or using the CefGlue .NET/Mono binding? Ask your questions here.

Moderator: fddima

cefglue - custom popup - how to set opener_window_handle ?

Postby RCK » Thu Dec 03, 2020 9:55 am

Hello All,

I'm using cefglue to navigate on a multi popup website.
I need to catch those popup to embed them into my own control (winform).

So I override the function to catch the popup creation by handling this myself (and return true to not let the real popup opening).
Code: Select all
CefLifeSpanHandler -> OnBeforePopup

I also override the function
Code: Select all
CefLifeSpanHandler -> OnAfterCreated

to call the event
Code: Select all
CefWebBrowser -> OnBrowserAfterCreated


It's working well, so I'm able to display the popup in my control, and the popup navigation is successfull.
But I got a problem, my custom popup browser could not communicate with the opener browser.
And I do not understand how set the opener_window_handle on my custom popup browser (handle null) :(

If I let the regular popup open ("return false" info OnBeforePopup), the popup can communicate with the opener correctly, because the browser opener_window_handle is correctly set.
Does someone knows how to handle custom popup with cefglue, and let them communicate with opener correctly ?

Thanks !
RCK
Newbie
 
Posts: 9
Joined: Tue Feb 14, 2017 7:25 am

Re: cefglue - custom popup - how to set opener_window_handle

Postby RCK » Fri Feb 12, 2021 8:42 am

Anybody knows how to set the opener_window_handle on a custom popup :?:
RCK
Newbie
 
Posts: 9
Joined: Tue Feb 14, 2017 7:25 am

Re: cefglue - custom popup - how to set opener_window_handle

Postby magreenblatt » Fri Feb 12, 2021 11:49 am

I don’t know CefGlue specifically, but in general you need to change the parent for the popup via CefWindowInfo.parent_window in OnBeforePopup. You can’t assign an opener after the fact.
magreenblatt
Site Admin
 
Posts: 10776
Joined: Fri May 29, 2009 6:57 pm

Re: cefglue - custom popup - how to set opener_window_handle

Postby fddima » Sat Feb 27, 2021 5:37 pm

magreenblatt wrote:I don’t know CefGlue specifically, but in general you need to change the parent for the popup via CefWindowInfo.parent_window in OnBeforePopup. You can’t assign an opener after the fact.


CefGlue doesn't add own abstractions (at least currently), so this works exactly in this way. :)
fddima
Master
 
Posts: 788
Joined: Tue Dec 07, 2010 6:10 am

Re: cefglue - custom popup - how to set opener_window_handle

Postby RCK » Fri Mar 19, 2021 12:37 pm

Dmitry help to me handle this problem, here is the solution for anyone interested 8-)
https://gitlab.com/xiliumhq/chromiumemb ... /issues/56
RCK
Newbie
 
Posts: 9
Joined: Tue Feb 14, 2017 7:25 am


Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 2 guests