Skip to content

Popup filter matches missed when using tabId option

Environment

  • Browser and full version: Chrome 101.0.4951.64
  • Extension using this toolkit: test-mv2
  • Commit hash: d9f77593 and 0.2.1

Steps to reproduce

  1. Run the following code:
EWE.filters.add(["||testpages.adblockplus.org/testfiles/popup/link.html^$popup"]);
EWE.reporting.onBlockableItem.addListener(console.log.bind(null, "all"))
chrome.tabs.create({url: "https://testpages.adblockplus.org/en/filters/popup"}, (tab) =>
{
  console.log("opener tab ID", tab.id);
  EWE.reporting.onBlockableItem.addListener(console.log.bind(null, "tab"), {tabId: tab.id});
});
  1. Click on "Trigger link based popup" link on test page.

Actual behavior

The following output is logged:

  • opener tab ID
  • all

Expected behavior

The following output is logged:

  • opener tab ID
  • all
  • tab

Further information

Note that the logged opener tab ID, which is used for setting up the "tab" listener, is different from the value of the request.tabId. That's fine, since the popup is a different tab, but it may explain why the listener for the opener tab is not triggered.

This is a regression and was originally reported as https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/-/issues/1128.