Bug 218403 - [GTK][WPE] Cannot remove individual scripts/stylesheets using WebKitUserContentManager
Summary: [GTK][WPE] Cannot remove individual scripts/stylesheets using WebKitUserConte...
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
Depends on:
Reported: 2020-10-30 13:31 PDT by Adrian Perez
Modified: 2020-11-03 00:40 PST (History)
7 users (show)

See Also:

WIP Patch (9.60 KB, patch)
2020-10-30 13:57 PDT, Adrian Perez
no flags Details | Formatted Diff | Diff
Patch (13.43 KB, patch)
2020-11-02 07:44 PST, Adrian Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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]
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].