uBlockOrigin / uBlock-issues

This is the community-maintained issue tracker for uBlock Origin
https://github.com/gorhill/uBlock
945 stars 81 forks source link

Wrong element is picked because other element is shown #2069

Closed spacevoyager78 closed 2 years ago

spacevoyager78 commented 2 years ago

Prerequisites

I tried to reproduce the issue when...

Description

See the following source code:

<a style="margin: 0 auto;text-align: center;border:none;line-height:1;display: block;text-decoration:none" href="https://www.ot.gr/2022/03/27/ot-forum/ot-forum-o-kosmos-pou-allazei-2/"  target="_blank" id="ot-forum">
    <picture>
    <source media="(min-width:800px)" srcset="/wp-content/themes/ingr_v2/common/imgs/ot640x100.jpg">
        <img src="/wp-content/themes/ingr_v2/common/imgs/ot330x100.jpg" alt="ingr" style="width:auto;">
    </picture>
</a>

I want to pick the banner. uBlock Origin sets the custom filter like this: ||www.in.gr/wp-content/themes/ingr_v2/common/imgs/ot330x100.jpg$image However, image is not blocked because Firefox displays the ot640x100.jpg image

A specific URL where the issue occurs

https://www.in.gr/2022/03/27/english-edition/real-estate-market-significant-increase-9-8-recorded-prices-new-apartments/

Steps to Reproduce

  1. Go to https://www.in.gr/2022/03/27/english-edition/real-estate-market-significant-increase-9-8-recorded-prices-new-apartments/
  2. Find the image banner that has the words OT FORUM
  3. Try to choose it with uBlock Origin in order to remove it.
  4. Reload the page

Expected behavior

Image is blocked.

Actual behavior

Image is not blocked.

uBlock Origin version

1.41.8

Browser name and version

Firefox 98.0.2 (64 bit)

Operating System and version

Windows 10 Pro x64 21H2

gorhill commented 2 years ago

The image is rendered using a <picture> > <source> layout, and uBO does not specifically handle picture elements.


Until this is fixed, you can use:

||www.in.gr/wp-content/themes/ingr_v2/common/imgs/ot*.jpg$image