Opened 8 months ago

Closed 7 months ago

Last modified 4 months ago

#7450 closed change (fixed)

Create hide-if-contains-visible-text snippet

Reported by: hfiguiere Assignee: hfiguiere
Priority: P2 Milestone:
Module: Core Keywords: circumvention
Cc: mjethani, fhd, ross, arthur, BrentM, laura Blocked By:
Blocking: #7337 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Ross Verified working: yes
Review URL(s):

https://codereview.adblockplus.org/30024560/

Description (last modified by hfiguiere)

Background

We need to be able to hide elements based on text they contain, even said text is polluted by invisible text to confuse ad blockers.

This is about doing a snippet version if the proposal in issue #7337.

What to change

  • Implement the snippet.
  • Write some tests

Note to testers

Setup page with this document.

<!DOCTYPE html>
<head>
   <style type="text/css">
      body {
        margin: 0;
        padding: 0;
      }
      .transparent {
        opacity: 0;
        position: absolute;
        display: block;
      }
      .zerosize {
        font-size: 0;
      }
      div {
        display: block;
      }
      .a {
        display: inline-block;
        white-space: pre-wrap;
      }
      .transparent {
        color: transparent;
      }
      .article {
        overflow-wrap: break-word;
      }
   </style>
</head>
<body>
  <div id="parent">
    <div class="article">
     <div class="label"><div class="a transparent">Sp</div><div class="a">Sp</div><div class="a zerosize">S</div><div class="a transparent">on</div><div class="a">on</div><div class="a zerosize">S</div>sored</div>
This is the ad.
    </div>
  </div>
</body>
</html>

The text "this is the ad." should be visible.

Add the filter

domain.com#$#hide-if-contains-visible-text Sponsored '#parent > .article' '#parent > .article .label'

The text should now be hidden.

Change History (16)

comment:1 Changed 8 months ago by mjethani

  • Priority changed from Unknown to P2
  • Ready set

comment:2 Changed 8 months ago by mjethani

Thanks for filing the issue.

Let's try to get this into ABP 3.6 or alternatively if we plan to do an ABP 3.5.2 release.

comment:3 Changed 8 months ago by hfiguiere

  • Cc mjethani fhd ross added

comment:4 Changed 8 months ago by arthur

  • Cc arthur added

comment:5 Changed 8 months ago by hfiguiere

  • Status changed from new to reviewing

comment:6 Changed 7 months ago by abpbot

A commit referencing this issue has landed:
Issue 7450 - Implement hide-if-contains-visible-text snippet

comment:7 Changed 7 months ago by hfiguiere

I'll close this after adding the hints for testers.

comment:8 Changed 7 months ago by hfiguiere

  • Description modified (diff)

comment:9 Changed 7 months ago by hfiguiere

  • Description modified (diff)

comment:10 Changed 7 months ago by hfiguiere

  • Description modified (diff)

comment:11 Changed 7 months ago by hfiguiere

  • Resolution set to fixed
  • Status changed from reviewing to closed

comment:12 Changed 5 months ago by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Done. Working as described.

ABP 0.9.15.2339
Microsoft Edge 44.17763.1.0 / Windows 10 1809

ABP 3.5.2.2340
Chrome 49.0.2623.75 / Windows 10 1809
Chrome 75.0.3770.142 / Windows 10 1809
Opera 36.0.2130.65 / Windows 10 1809
Opera 62.0.3331.72 / Windows 10 1809
Firefox 51.0 / Windows 10 1809
Firefox 68.0 / Windows 10 1809
Firefox Mobile 68.0 / Android 7.2.2

comment:13 Changed 4 months ago by sebastian

  • Cc brentm added

comment:14 Changed 4 months ago by sebastian

  • Cc BrentM added; brentm removed

comment:15 Changed 4 months ago by BrentM

  • Cc laura added

comment:16 Changed 4 months ago by hfiguiere

  • Sensitive unset
Note: See TracTickets for help on using tickets.