Opened on 04/08/2019 at 04:11:43 PM

Closed on 05/10/2019 at 04:33:41 PM

Last modified on 08/15/2019 at 02:54:52 AM

#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):

Description (last modified by hfiguiere)


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>
   <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;
  <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.

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

Add the filter$#hide-if-contains-visible-text Sponsored '#parent > .article' '#parent > .article .label'

The text should now be hidden.

Attachments (0)

Change History (16)

comment:1 Changed on 04/08/2019 at 06:08:04 PM by mjethani

  • Priority changed from Unknown to P2
  • Ready set

comment:2 Changed on 04/08/2019 at 06:09:04 PM 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 on 04/12/2019 at 12:55:56 PM by hfiguiere

  • Cc mjethani fhd ross added

comment:4 Changed on 04/12/2019 at 12:58:46 PM by arthur

  • Cc arthur added

comment:5 Changed on 04/12/2019 at 01:03:01 PM by hfiguiere

  • Status changed from new to reviewing

comment:6 Changed on 05/10/2019 at 02:16:01 PM by abpbot

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

comment:7 Changed on 05/10/2019 at 02:51:52 PM by hfiguiere

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

comment:8 Changed on 05/10/2019 at 04:31:53 PM by hfiguiere

  • Description modified (diff)

comment:9 Changed on 05/10/2019 at 04:32:37 PM by hfiguiere

  • Description modified (diff)

comment:10 Changed on 05/10/2019 at 04:32:59 PM by hfiguiere

  • Description modified (diff)

comment:11 Changed on 05/10/2019 at 04:33:41 PM by hfiguiere

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

comment:12 Changed on 07/26/2019 at 12:01:46 PM by Ross

  • Tester changed from Unknown to Ross
  • Verified working set

Done. Working as described.

Microsoft Edge 44.17763.1.0 / Windows 10 1809

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 on 08/14/2019 at 01:11:15 AM by sebastian

  • Cc brentm added

comment:14 Changed on 08/14/2019 at 09:44:53 PM by sebastian

  • Cc BrentM added; brentm removed

comment:15 Changed on 08/14/2019 at 10:01:05 PM by BrentM

  • Cc laura added

comment:16 Changed on 08/15/2019 at 02:54:52 AM by hfiguiere

  • Sensitive unset

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from hfiguiere.
Note: See TracTickets for help on using tickets.