getting browser width and height from CefBrowser object

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

Moderator: fddima

getting browser width and height from CefBrowser object

Postby JohnConnor » Tue Jul 25, 2017 2:42 am


is there an easy way of getting the browser width and height from the cefBrowser?
The thing I am trying to achieve is set the same window size for popups as the window which created it. For example my main window is 800x600 and when I click on the link - new popup shows up, but the size is not the same as of parent window. I have overridden the OnBeforePopup method in CefLifespanHandler and I need to check if the value of window being created is really the same. I would prefer to do it in CefLifespanhandler::OnAfterCreated - but it only carries the CefBrowser.
Any thoughts on this for how could I get the window width and height of windows being created?

The idea I had was to get the opener window handle by calling GetOpenerWindowHandle() on cefBrowser object of popup window. The to use this somehow and get the cefWindowInfo of the parent window. From CefWindowInfo I could get the width and height - but the question here would be - is it possible to get the windowInfo?
Posts: 21
Joined: Tue Mar 21, 2017 2:27 am

Return to CefGlue Forum

Who is online

Users browsing this forum: No registered users and 2 guests