Performance regression in 3.9
Environment
- Chrome 83, Firefox 78 (Windows 10) and Edge (see forum post).
- Adblock Plus 3.9 and Adblock (see forum post and forum post).
- Filter lists:
- ABP filters
- Adblock Warning Removal List
- EasyList
- EasyPrivacy
- Fanboy's Social Blocking List
- Malware Domains
How to reproduce
- Add the custom filter
@@||*$document
Observed behavior
- The following error message is shown:
- Chrome: "Waiting for extension Adblock Plus"
- Firefox: "A script in the extension 'Adblock Plus - free ad blocker' is causing Firefox to slow down."
- Pages aren't loading.
Expected behavior
- No error should be shown.
- Pages should be loading without delay.
Further information
Since the pattern of this filter is ""
, the condition index != -1
in the while-statement in adblockpluscore/lib/filterClasses.js is never true
, causing it to loop indefinitely.
In addition to fixing the handling of the empty string, we should probably also add a second exit condition, to avoid getting stuck, if the index is greater than expected (e.g. index >= location.length
).
Notes
- Problem occurs on all sites.
- Problem occurs only sometimes and most often on specific sites such as Facebook (see forum post).
- Unable to open settings page (see forum post and forum post).
- Can be worked around by disabling and reenabling extension (see forum post).
- Everything stops loading again after reenabling extension (see forum post).
- CPU usage at 100% (see forum post).
- We're not sure what has been causing this, but suspect it might be snippet related. As a potential mitigation we have removed some snippet filters:
- See also related forum threads:
Edited by Thomas Greiner