Bug 169167 - REGRESSION: Content Blocker: Blocking "a[href*=randomString]" doesn't work
Summary: REGRESSION: Content Blocker: Blocking "a[href*=randomString]" doesn't work
Status: RESOLVED FIXED
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
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-03-04 00:26 PST by jonathan.arnold
Modified: 2017-03-27 04:59 PDT (History)
5 users (show)

See Also:


Attachments
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
<rdar://problem/30852110>
Comment 3 Radar WebKit Bug Importer 2017-03-04 11:24:53 PST
<rdar://problem/30852111>
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:
https://forum.adguard.com/index.php?threads/ad-blocking-is-not-working-properly-in-ios-10-3-beta.19898/
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]
patch
Comment 10 Alex Christensen 2017-03-24 11:18:11 PDT
http://trac.webkit.org/r214358
Comment 11 jonathan.arnold 2017-03-27 04:59:37 PDT
Thank you Alex!
Will this fix be included in the next beta?