Skip to content

Blocked ads counter isn't automatically updated in the Bubble UI

Environment

  • Operating system: macOS 10.12 (I can feel you silently judging me!)
  • Browser version: Chrome 78.0.3904.97
  • Extension version: 3.7
  • Last working version: N/A

Steps to reproduce

  1. Open this article with ABP installed
  2. Open the Bubble UI
  3. Let the extension block further requests while keeping the Bubble UI open

Alternative:

  1. Go to example.com.
  2. Open JavaScript console and run setInterval(() => fetch("ad.js"), 2000)
  3. Open the Bubble UI.
  4. Let the extension block further requests while keeping the Bubble UI open

Observed behavior

The ads blocked counter in the ABP extension icon showed 91 blocked ads. After opening the bubble UI, the counter inside the bubble UI showed 91 blocked ads. However, more ads were loaded and blocked by ABP - the extension's icon counter reflected the updated number, 131, but this number wasn't updated in the bubble UI as well.

Expected behavior

Both the extension icon counter and the bubble UI counter should automatically update themselves at the same time with the total number of ads blocked.

Further information

screenshot

Hints for testers

Initialization of blocked counters in icon popup should work as expected and should both be updated whenever the icon counter changes.

After dependency update, make sure to retest the bug is fixed on all supported browsers: Firefox, Chrome, Opera, Edge.

Integration notes

This is the first time that we're listening to messages from a UI which doesn't have a tab associated to it. Therefore the code that handles "*.listen" messages needs to be updated accordingly. Otherwise an error will be thrown in lib/filterConfiguration.js when it tries to access uiPort.sender.tab.id. Note that while Chrome and Firefox don't set uiPort.sender.tab, Edge doesn't even set uiPort.sender.

Furthermore, to fix this bug on Firefox we need to have the the preference listener trigger each time when the "blocked_total" preference updates. However, the extension currently limits that to only once per second.

Edited by Ursa Kacar
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information