Skip to content

Fixed #90 - Trigger element collapsing as the request is blocked

When a request is blocked the respective element (if any) is supposed to be hidden. Since there is no direct method to associate requests in the extension with elements in the DOM, we currently listen for error events (or load events in case of frames) of all elements in the DOM, then query the extension whether a request with the element's source URL would be blocked, and if so hide it.

This MR implements an alternative approach, where instead the extension sends a message ahead once a request was blocked, then the content script once it receives the message finds elements with the matching URL and type in the DOM, and hides them.

This approach appears to be much simpler (~75 lines less of code). Moreover, it works as well for frames on Firefox, and <object> elements as in those scenarios no DOM event is triggered when the resource was blocked.

Edited by Sebastian Noack

Merge request reports