Opened 5 days ago

Closed 5 days ago

Last modified 33 hours ago

#7210 closed change (fixed)

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

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: Unknown Verified working: no
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 (6)

comment:1 Changed 5 days ago by sebastian

  • Description modified (diff)

comment:2 Changed 5 days ago by sebastian

  • Priority changed from Unknown to P2
  • Ready set
  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:3 Changed 5 days ago by abpbot

comment:4 Changed 5 days ago by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Firefox-next
  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:5 Changed 33 hours ago by sebastian

  • Milestone changed from Adblock-Plus-for-Chrome-Opera-Firefox-next to Adblock-Plus-3.4.3-for-Chrome-Opera-Firefox

comment:6 Changed 33 hours ago by abpbot

Note: See TracTickets for help on using tickets.