[webkit-help] Create a WebView without window -- no need to display
emmanuel.rodriguez at gmail.com
Wed Dec 19 07:08:47 PST 2012
On 18 December 2012 17:36, y w <ytrac00 at yahoo.com> wrote:
> Hi All,
> I am using WebKit with GTK port in Ubuntu. My project is to get the
> domtree of a webpage and save it in background. I do not need to download
> the external resources of the page(such as images, script files and css
> files) but need save the url of this resources.
> I am using WebKit GTK create a webview to load the page, the problem is it
> always open a window and start display all resources even if I hide the
> hide window.
> How can I create the webview without attach it to a window?
In this example  I managed to use a WebView without a
window. Although you you might want to either use an xserver that runs on a
framebuffer  and to put the webview in a window or to use
a GtkOffscreenWindow  instead of a window.
I had mixed results when using an offscreen window with a webview. I got
the best results when I use a standard gtk window and run the program in a
> How should I do if I do not want to download external resources?
You can connect to a webview's signal 'resource-request-starting' and
decide if you want to allow the extra resources to be downloaded or not. To
reject a resource set the request's uri to "about:blank"
Take a look at this sample program 
I hope that it helps.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-help