Add ability for Content Blockers to block/hide elements based on their innerHTML/text

Originator:pedrovcristao
Number:rdar://23971363 Date Originated:21-Dec-2015 08:04 AM
Status:Open Resolved:
Product:iOS SDK Product Version:iOS 9+
Classification:Feature (New) Reproducible:
 
Summary:
Basically what I ask is for a way to allow a Content Blocker to block/hide an element based on its innerHTML/text value.

For instance,
<p>Text that I want to block</p>
There's no way of blocking this <p> element based on its text since CSS Selectors do not support innerHTML, only tag attributes.

One way to allow this, directly in the Content Blocker's blockerList.json:
"action": {
    "type": "css-display-none",
    "selector": "p[innerHTML*='Text that I want to block']"
}

Doing this would open up a world of possibilites for Content Blockers.

Steps to Reproduce:
See description to get the idea.

Expected Results:
The element would be blocked.

Actual Results:
Currently it's not possible.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!