Declarative Net Request: Collapse blocked <img> elements.
With Declarative Net Request, there is no easy way for extensions to collapse the DOM elements corresponding to the resources they blocked. This CL implements the ability for the blocked <img> elements to be automatically collapsed in the DOM. In subsequent CLs, similar function will be implemented for other DOM elements. To do this, following changes are made: - A new field called kCollapsedByClient is added to blink::ResourceRequestBlockedReason. Whenever an extension ruleset wants to collapse the DOM element corresponding to a network request, the extended_error_code is set to kCollapsedByClient, which is then used as a signal by the renderer to perform the collapsing. - Changes to blink::ResourceRequestBlockedReason also necessiate changes to the Devtools protocol. As a good side-effect, resources collapsed by extensions would be marked as "collapsed-by-client" by Devtools. - Changes are made to allow content embedders to set a blink::ResourceRequestBlockedReason for a request. BUG=848842 Cq-Include-Trybots: luci.chromium.try:linux_mojo Change-Id: I0bfd1a60bee79ef651741b7655fade6be4a7d419 Reviewed-on: https://chromium-review.googlesource.com/1088189 Commit-Queue: Matt Menke <mmenke@chromium.org> Reviewed-by:Istiaque Ahmed <lazyboy@chromium.org> Reviewed-by:
Nasko Oskov <nasko@chromium.org> Reviewed-by:
Nate Chapin <japhet@chromium.org> Reviewed-by:
Andrey Kosyakov <caseq@chromium.org> Reviewed-by:
Dmitry Gozman <dgozman@chromium.org> Reviewed-by:
Matt Menke <mmenke@chromium.org> Cr-Commit-Position: refs/heads/master@{#568332}
Showing
Please register or sign in to comment