Bug 169167 - REGRESSION: Content Blocker: Blocking "a[href*=randomString]" doesn't work
Summary: REGRESSION: Content Blocker: Blocking "a[href*=randomString]" doesn't work
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: Safari Technology Preview
Hardware: iPhone / iPad iOS 10
: P2 Major
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2017-03-04 00:26 PST by jonathan.arnold
Modified: 2017-03-27 04:59 PDT (History)
5 users (show)

See Also:

patch (4.64 KB, patch)
2017-03-24 11:11 PDT, Alex Christensen
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jonathan.arnold 2017-03-04 00:26:51 PST
With the newest xcode beta this won't work anymore:

    "trigger": {
        "url-filter": ".*"
    "action": {
        "selector": "a[href*=randomString]",
        "type": "css-display-none"

In older version it worked perfectly fine.
Comment 1 Alexey Proskuryakov 2017-03-04 11:24:36 PST
Just to confirm, this regressed with new SDK, and Safari version is the same?
Comment 2 Radar WebKit Bug Importer 2017-03-04 11:24:52 PST
Comment 3 Radar WebKit Bug Importer 2017-03-04 11:24:53 PST
Comment 4 jonathan.arnold 2017-03-04 12:25:29 PST
yes, its with the new SDK. (iOS Beta 10.3)
Comment 5 Andrey Meshkov 2017-03-16 03:15:48 PDT
Moreover, selectors like `[attribute="value"]` do not work anymore.

This issue is easily reproducible in iOS 10.3 Beta.

Relevant discussion:
Comment 6 jonathan.arnold 2017-03-16 04:28:32 PDT
Dear Webkit Developers,
any chance on fixing this issue soon?
Comment 7 Alex Christensen 2017-03-16 16:15:45 PDT
I tried to reproduce this and found everything working correctly.  Here are my steps for reproduction:

1) Put this into test.json on my desktop:
[{"trigger":{"url-filter": ".*"},"action":{"selector":"a[href*=randomString]","type":"css-display-none"}}]
2) Put this into test.html on my desktop:
<body><a href="http://webkit.org/randomString">This should be hidden.</a>This should not</body>
2) Compile WebKit and run Tools/Scripts/run-minibrowser
3) Open a new WebKit2 window in MiniBrowser.
4) In MiniBrowser's Debug menu, open the extensions manager.
5) Add test.json.
6) Notice that "This should be hidden." disappears.

This indicates that everything seems to be working correctly. If you find a modification to my reproduction steps that shows incorrect behavior, please elaborate.
Comment 8 jonathan.arnold 2017-03-16 22:33:16 PDT
Hi Alex,
thank you for looking into it. :-)

Have you tried the same with the current iOS beta?
This where the issue came up. Maybe it is only iOS that is effected of this.

In the new iOS beta its not working for me :-(
Comment 9 Alex Christensen 2017-03-24 11:11:43 PDT
Created attachment 305300 [details]
Comment 10 Alex Christensen 2017-03-24 11:18:11 PDT
Comment 11 jonathan.arnold 2017-03-27 04:59:37 PDT
Thank you Alex!
Will this fix be included in the next beta?