[webkit-dev] disableing webkit plugins on gtk+ port

Christian Dywan christian at twotoasts.de
Thu Jan 8 07:50:17 PST 2009


Am Thu, 08 Jan 2009 15:30:07 +0100
schrieb Zan Dobersek <zandobersek at gmail.com>:

> Luka Napotnik wrote:
> > Hello.
> > 
> > I'm trying to disable plugins on the gtk+ port of webkit. I've
> > tried to modify the WebKitWebSettings property "enable-plugins" but
> > my program segfaults. Here's the code:
> > 
> > WebKitWebSettings *settings;
> > ...
> > settings = webkit_web_view_get_settings(web_view);
> > g_object_set_property(G_OBJECT(settings), "enable-plugins",
> > "FALSE"); webkit_web_view_set_settings(web_view, settings);
> > 
> > Am I doing this right or is there another way?
> > 
> > Greets,
> > Luka
> > 
> > _______________________________________________
> > webkit-dev mailing list
> > webkit-dev at lists.webkit.org
> > http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
> > 
> 
> Similarly to what's being done in DumpRenderTree.cpp [1], you should
> use g_object_set:
> 
>  > ...
>  > settings = webkit_web_view_get_settings(web_view);
>  > g_object_set(G_OBJECT(settings),
>  >              "enable-plugins", FALSE,
>  >              NULL);
>  > // webkit_web_view_set_settings is now not needed

Even better, just write

settings = webkit_web_view_get_settings (web_view);
g_object_set (settings, "enable-plugins", FALSE, NULL);

You don't need to case the first argument since it expects void*.

ciao,
    Christian


More information about the webkit-dev mailing list