Skip to content

Autogenerated filter breaks a web page #2519

@nerdius

Description

@nerdius

Describe the issue

I'm not sure if it's a feature, but it's most likely a bug, I think. So, I was trying to block an element that included ads, but it was blocking other elements on the page as well. I started by right-clicking the element and clicking Block element. Then I tried to inspect the web page (which, BTW, is very poorly designed) and it seemed that there was nothing wrong with the filter that uBlock Origin has generated, but it was clearly blocking other portions of the page as well. After about 5 minutes of tinkering, suddenly, it hit me. The autogenerated filter's CSS selector doesn't start with body >, so it matches multiple elements in the DOM tree.

One or more specific URLs where the issue occurs

  • Page URL: https://forum.ge/
    • Ad container CSS selector: body > table > tbody > tr > td:nth-child(2)
    • Ad container XPath: /html/body/table/tbody/tr/td[2]

Screenshot in which the issue can be seen

uBlock element picker

Steps for anyone to reproduce the issue

  1. Right-click the element.
  2. Click Block element.

Your settings

  • Autogenerated filter: ##table > tbody > tr > td:nth-of-type(2)
  • Working filter: ##body > table > tbody > tr > td:nth-of-type(2)
  • OS/version: Manjaro Linux 17.0.1 (Gellivara) KDE
  • Browser/version: Chrome 57.0.2987.110 (Stable channel)
  • uBlock Origin version: 1.11.4
Your filter lists

Irrelevant.

Your custom filters (if any)

Irrelevant.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions