Bug 218403

Summary: [GTK][WPE] Cannot remove individual scripts/stylesheets using WebKitUserContentManager
Product: WebKit Reporter: Adrian Perez <aperez>
Component: WebKitGTKAssignee: Adrian Perez <aperez>
Status: RESOLVED FIXED    
Severity: Normal CC: berto, bugs-noreply, cgarcia, ews-watchlist, gustavo, jan.brummer, mcatanzaro
Priority: P2    
Version: WebKit Local Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
WIP Patch
none
Patch none

Description Adrian Perez 2020-10-30 13:31:45 PDT
Currently there are webkit_user_content_manager_remove_filter[_by_id]
but no equivalent for scripts and stylesheets. There is no reason why
webkit_user_content_manager_remove_{script,style_sheet} shouldn't be
available >_<
Comment 1 Adrian Perez 2020-10-30 13:57:52 PDT
Created attachment 412796 [details]
WIP Patch

This should work, modulo missing test cases,
which I will be adding if people agree we want to do these
two additions to the public API ^_^
Comment 2 EWS Watchlist 2020-10-30 13:59:02 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See https://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Michael Catanzaro 2020-10-30 15:16:39 PDT
LGTM. I guess Ephy ought to use this when its user script/style preferences are disabled?
Comment 4 Jan-Michael Brummer 2020-10-31 01:34:45 PDT
Yes, we need it there and also for my WebExtensions branch.
Comment 5 Adrian Perez 2020-11-02 07:44:40 PST
Created attachment 412919 [details]
Patch
Comment 6 EWS 2020-11-03 00:40:52 PST
Committed r269287: <https://trac.webkit.org/changeset/269287>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 412919 [details].