Page 1 of 1

cefglue - custom popup - how to set opener_window_handle ?

PostPosted: Thu Dec 03, 2020 9:55 am
by RCK
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 !

Re: cefglue - custom popup - how to set opener_window_handle

PostPosted: Fri Feb 12, 2021 8:42 am
by RCK
Anybody knows how to set the opener_window_handle on a custom popup :?:

Re: cefglue - custom popup - how to set opener_window_handle

PostPosted: Fri Feb 12, 2021 11:49 am
by magreenblatt
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.

Re: cefglue - custom popup - how to set opener_window_handle

PostPosted: Sat Feb 27, 2021 5:37 pm
by fddima
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. :)

Re: cefglue - custom popup - how to set opener_window_handle

PostPosted: Fri Mar 19, 2021 12:37 pm
by RCK
Dmitry help to me handle this problem, here is the solution for anyone interested 8-)
https://gitlab.com/xiliumhq/chromiumemb ... /issues/56