Skip to content

Performance regression in 3.9

Environment

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

Edited by Dave Vandyke