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

Zan Dobersek zandobersek at gmail.com
Thu Jan 8 06:30:07 PST 2009


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

Regards,
Zan Dobersek

[1]http://trac.webkit.org/browser/trunk/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp#L199


More information about the webkit-dev mailing list