Opened 4 years ago

Closed 4 years ago

#2132 closed change (fixed)

Only match exception rules when checking whether a page/frame is whitelisted

Reported by: sebastian Assignee: sebastian
Priority: P4 Milestone: Adblock-Plus-1.9-for-Chrome-Opera-Safari
Module: Platform Keywords:
Cc: mapx Blocked By:
Blocking: Platform: Unknown
Ready: yes Confidential: no
Tester: Verified working:
Review URL(s):

http://codereview.adblockplus.org/5733398375038976

Description (last modified by sebastian)

Background

There are currently 12 calls to isPageWhitelisted() and isFrameWhitelisted() spread over the code, most critically in the event listener for onBeforeRequest and when composing element hiding selectors for every document. Those functions call defaultMatcher.matchesAny() instanceof WhitelistFilter. However, this matches not only exception rules but also blocking filters, and therefore degrades speed.

What to change

Call defaultMatcher.whitelist.matchesAny() instead defaultMatcher.matchesAny() when only checking for exception rules.

Hints for testers

Make sure that exception rules still work correctly and trhat whitelisted pages are still indicated correctly.

Change History (4)

comment:1 Changed 4 years ago by mapx

  • Cc mapx added

comment:2 Changed 4 years ago by sebastian

  • Description modified (diff)

comment:3 Changed 4 years ago by sebastian

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:4 Changed 4 years ago by sebastian

  • Milestone set to Adblock-Plus-for-Chrome-Opera-Safari-next
  • Resolution set to fixed
  • Status changed from reviewing to closed
Note: See TracTickets for help on using tickets.