Opened 6 months ago

Last modified 6 months ago

#7275 new defect

Cannot filter list in DevTools by $document

Reported by: greiner Assignee:
Priority: Unknown Milestone:
Module: Platform Keywords:
Cc: sebastian, kzar, arthur Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description

Environment

Ubunut 16.04
Chrome 71
Adblock Plus 3.4.1

How to reproduce

  1. Add the custom filter @@||www.youtube-nocookie.com^$document,domain=adblockplus.org
  2. Go to adblockplus.org
  3. Open DevTools window and switch to "Adblock Plus" tab
  4. Click twice on homepage video to load YouTube frame
  5. Filter list to only show entries with "DOCUMENT" type

Observed behaviour

No such option exists.

Expected behaviour

Option exists and list can be filtered to only show entries with "DOCUMENT" type.

Further information

While we decide in adblockplusui/lib/messageResponder.js which types the user is able to user as a filter, we generate that list in adblockpluschrome/lib/requestBlocker.js.

First, it's questionable whether filterTypes should be used since the "data-type" attribute on each entry corresponds to the request type.

Secondly, filterTypes doesn't contain "DOCUMENT" because neither does browser.webRequest.ResourceType which this list is primarily based on.

Change History (2)

comment:1 Changed 6 months ago by greiner

  • Cc arthur added

comment:2 Changed 6 months ago by sebastian

We add other items to filterTypes (in lib/requestBlocker.js) that aren't mapped from browser.webRequest.ResourceType, specifically so that they show up here (e.g. POPUP). However, whitelisting-only types (i.e. DOCUMENT, GENRICBLOCK and GENERICHIDE) aren't included.

Back then, I might have thought filtering for whitelisted requests is good enough in that case, also I didn't want to unnecessarily bloat the list of drop down items. Finally, IIRC, you couldn't filter for these types in "blockable items" in the legacy Gecko extension either.

FWIW, the whole filtering UI of the devtools panel isn't great, but it's the best I could come up with for the MVP back then. Maybe it's time to revamp it in a way that scales better with more filtering options.

Last edited 6 months ago by sebastian (previous) (diff)
Note: See TracTickets for help on using tickets.