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(WebKitUserContentManager*);

(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?

--
 ⌨ 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.

---
[1] https://webkit.org/blog/3476/content-blockers-first-look/
[2] 
http://webkitgtk.org/reference/webkit2gtk/stable/WebKitUserContentManager.html

Attachment: signature.asc
Description: signature

_______________________________________________
webkit-gtk mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-gtk

Reply via email to