Getting the size of an opening window in WebKit
Posted
by ThereSkippy
on Stack Overflow
See other posts from Stack Overflow
or by ThereSkippy
Published on 2010-05-19T20:16:56Z
Indexed on
2010/05/19
20:20 UTC
Read the original article
Hit count: 161
Hi,
I'm implementing a "WebKit Browser In An Application" which basically embeds WebViews in Qt widgets (we're using the WebKit browser instead of Qt's since it's stabler and more up-to-date).
So far everything's great, until someone clicks on a link which invokes a Javascript "Window.open" function with a custom width and height for the new window.
I've set the various delegates for the parent window: setFrameLoadDelegate, setResourceLoadDelegate, setPolicyDelegate, and setUIDelegate.
I am getting a createWebViewWithRequest in the UI delegate as expected when the window opens (with a null request, as others have noted).
I then get a decidePolicyForNavigationAction for the new window, but it doesn't have the proposed window's width or height.
I NEVER get a decidePolicyForNewWindowAction for JavaScript window.open (also noted by others).
So I'm at a loss. Is there a way to get this information so I can set the Qt Widget's size correctly?
© Stack Overflow or respective owner