Opened 21 months ago

Last modified 20 months ago

#7210 closed change

Skip redundant round-trips to the background page when collapsing elements targeted by the same selector — at Version 1

Reported by: sebastian Assignee: sebastian
Priority: P2 Milestone: Adblock-Plus-3.4.3-for-Chrome-Opera-Firefox
Module: Platform Keywords:
Cc: mjethani, kzar Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://gitlab.com/eyeo/adblockplus/adblockpluschrome/merge_requests/26

Description (last modified by sebastian)

Background

In include.preload.js, we already keep track of selectors used for element collapsing, in order to avoid injecting the same selector twice. However, we still send a message to the background page for every failed attempt to load an element regardless whether we have seen the resulting selector before. Instead, we could keep tack of all seen selectors (which most of the time will be the same number of selectors we inject), and skip the messaging with the background page altogether for selectors we have seen before.

That way we also avoid Firefox to run out of memory if a page attempts to reload a resource that failed to load (or was blocked) at a high frequency, see Firefox bug 1516508.

What to change

Keep track of all selectors considered for element collapsing, and don't send more than one filters.collapse message for elements that are targeted by an incidental selector.

Change History (1)

comment:1 Changed 21 months ago by sebastian

  • Description modified (diff)
Note: See TracTickets for help on using tickets.