[webkit-gtk] [RFC] New API: support user content filters in WebKitUserContentManager

Carlos Garcia Campos cgarcia at igalia.com
Fri Feb 19 05:06:26 PST 2016


El mar, 16-02-2016 a las 17:22 +0200, Adrián Pérez de Castro escribió:
> Hi everybody!
> 
> This is a proposal to expose support for “content blockers” [1]
> (a.k.a.
> “user content filters”) in the WebKitGTK+ API. Yesterday I took a
> quick
> look to the Cocoa port, and it turns out that the implementation is
> in
> WebCore waiting to be wrapped. Like user style sheets and user
> scripts,
> I think it fits to expose it with methods on WebKitUserContentManager
> [2]:
> 
>   void
> webkit_user_content_manager_add_filter(WebKitUserContentManager*
>                                               WebKitUserContentFilter
> *);
> 
>   void
> webkit_user_content_manager_remove_all_filters(WebKitUserContentManag
> er*);
> 
> (Plus functions to instantiate and ref/unref WebKitUserContentFilter
> objects,
> like it's done for WebKitUser{Script,StyleSheet}.)
> 
> It would be great to support this, because it would allow programs
> using
> WebKitGTK+ to reuse the user content filtering framework, and avoid
> the
> current situation in which each has to reimplement this functionality
> as a WebProcess plug-in. Not to mention that the user content filter
> support from WebCore is faaaast (rules are compiled to machine code!)
> :-)
> 
> If this sounds like a good idea, I can invest some of my time to make
> it
> happen — I have implemented most of WebKitUserContentManager and I it
> does
> not look like it would take a lot of effort.
> 
> WDYT?

Proposal looks good to me.

> --
>  ⌨ Adrian
> 
> P.S: I would love to see Epiphany's ad blocking support rewritten to
> make use
> of user content filters. I could even try to do that myself as to
> exercise
> the new API.

That would be desirable, yes :-)

IIRC Emanuele was also interested in this, and opened bugs.

> ---
> [1] https://webkit.org/blog/3476/content-blockers-first-look/
> [2] http://webkitgtk.org/reference/webkit2gtk/stable/WebKitUserConten
> tManager.html
> _______________________________________________
> webkit-gtk mailing list
> webkit-gtk at lists.webkit.org
> https://lists.webkit.org/mailman/listinfo/webkit-gtk
-- 
Carlos Garcia Campos
http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.webkit.org/pipermail/webkit-gtk/attachments/20160219/4d60d708/attachment.sig>


More information about the webkit-gtk mailing list