Opened 19 months ago

Closed 17 months ago

Last modified 13 months ago

#6969 closed change (fixed)

Implement abort-on-property-read snippet — at Version 17

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

https://codereview.adblockplus.org/29886700/

Description (last modified by mjethani)

Background

Some circumvention need to block some properties from being read. So the snippet abort-on-property-read should do the trick.

What to change

Add a snippet abort-on-property-read that prevent reading a property.

Hints for testers

Try this:

<!-- test.html -->
<div>
  Lorem ipsum dolor sit amet, consectetur
  adipiscing elit, sed do eiusmod tempor
  incididunt ut labore et dolore magna aliqua.
</div>
<script src="script.js"></script>
/* script.js */
adsShown = false;

setTimeout(() =>
{  
  if (!adsShown)
  {
    let ad = document.createElement("div");
    ad.id = Math.random().toString(36).substring(2);
    ad.innerHTML = "<div><span>Check this!</span><span class='label'>Ad</span></div>";
    document.body.appendChild(ad);

    adsShown = true;
  }
},
500);

When you load this page, it should show the "Check this!" ad. If you then add the filter localhost#$#abort-on-property-read adsShown and reload the page, the ad should no longer be shown. Also there should be no error in the tab's console.

Change History (17)

comment:1 Changed 19 months ago by hfiguiere

  • Description modified (diff)
  • Owner set to hfiguiere

comment:2 Changed 19 months ago by hfiguiere

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:3 Changed 19 months ago by arthur

  • Cc arthur added

comment:4 Changed 19 months ago by hfiguiere

  • Cc Ross added
  • Description modified (diff)

comment:5 Changed 19 months ago by hfiguiere

  • Description modified (diff)

comment:6 Changed 19 months ago by hfiguiere

  • Description modified (diff)

comment:7 Changed 17 months ago by hfiguiere

  • Description modified (diff)

comment:8 Changed 17 months ago by mjethani

chefkoch.de,pcwelt.de,vox.de,cinema.de#$#abort-on-property-read trckd
chefkoch.de,pcwelt.de,vox.de,cinema.de#$#abort-on-property-read uabpd3

This can also be just one filter, like so:

chefkoch.de,pcwelt.de,vox.de,cinema.de#$#abort-on-property-read trckd; abort-on-property-read uabpd3

comment:9 Changed 17 months ago by abpbot

A commit referencing this issue has landed:
Issue 6969 - Implement abort-on-property-read snippet

comment:10 Changed 17 months ago by hfiguiere

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

comment:11 Changed 17 months ago by abpbot

A commit referencing this issue has landed:
Issue 6969 - Implement abort-on-property-read snippet

comment:12 Changed 17 months ago by mjethani

Hubert, I think the hints for testers should have a standalone test case just like all the other snippets (see #6919 for example).

comment:13 Changed 17 months ago by mjethani

  • Resolution fixed deleted
  • Status changed from closed to reopened

I am reopening this until there's a standalone test case.

comment:14 Changed 17 months ago by mjethani

  • Description modified (diff)
  • Resolution set to fixed
  • Status changed from reopened to closed

comment:15 Changed 17 months ago by mjethani

  • Ready set

comment:16 Changed 17 months ago by mjethani

  • Description modified (diff)

comment:17 Changed 17 months ago by mjethani

  • Description modified (diff)
Note: See TracTickets for help on using tickets.