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).
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
- Unable to open settings page to remove filter again (see forum post and forum post).
- See also related forum threads:
- The regression was introduced with this commit: https://gitlab.com/eyeo/adblockplus/adblockpluscore/-/merge_requests/345/diffs
Edited by Dave Vandyke