How to resize popup windows? resizeTo() resizeBy() not working

431 views
Skip to first unread message

Mike Baker

unread,
Sep 10, 2015, 2:25:00 AM9/10/15
to CefSharp
Hi,

I'm trying to resize a popup window using the javascript functions resizeTo() and resizeBy() but nothing happens when these functions are called in cefsharp. Are resizeTo() and resizeBy() supported by cefsharp for popup windows or is there another workaround to enable resizing of popups?

The popup window is a child window created using window.open(). The resize works fine in a native chrome browser but nothing happens when executed inside cefsharp. 

Thanks.


Alex Maitland

unread,
Sep 10, 2015, 5:11:23 AM9/10/15
to CefSharp
Version? WinForms or WPF?

Alex Maitland

unread,
Sep 10, 2015, 5:18:43 AM9/10/15
to CefSharp
Also it's worth trying to identify if this is an upstream CEF issue or a CefSharp problem

https://github.com/cefsharp/CefSharp/blob/master/CONTRIBUTING.md#cefsharp-vs-cef

Mike Baker

unread,
Sep 10, 2015, 8:16:52 PM9/10/15
to CefSharp
We are using CefSharp.WinForms 41.0.1

According to https://bitbucket.org/chromiumembedded/cef/issues/698  it looks like it might be an open request with CEF.

Mike Baker

unread,
Sep 11, 2015, 12:45:59 AM9/11/15
to CefSharp
I tried the CefBuild TestApp and it doesn't appear to work in that either.
CEF3.2494.1321.ge343da7
Chromium47.0.2494.0


Alex Maitland

unread,
Sep 14, 2015, 6:28:59 AM9/14/15
to CefSharp
In the next version (currently `43.0.0-pre02`) you can get the popup window handle and move it around yourself. With a bit of work you could likely intercept the JS methods and move the window around yourself. (Not tried it, just a rough idea at this stage).

Not sure if this helps.

Mike Baker

unread,
Sep 17, 2015, 7:32:10 PM9/17/15
to CefSharp
Thanks. We will keep an eye on the next release. In the meantime, we intercept the javascript and use the following native methods to get the window handle and perform the resize:
FindWindow
GetWindowRect
GetClientRect
SetWindowPos

Reply all
Reply to author
Forward
0 new messages