RESOLVED INVALID207543
WKContentRuleList rules does not allow you to block ThirdParty cookies
https://bugs.webkit.org/show_bug.cgi?id=207543
Summary WKContentRuleList rules does not allow you to block ThirdParty cookies
Brandon
Reported 2020-02-11 06:42:56 PST
Created attachment 390362 [details] Example where it throws an error If you call `WKContentRuleStore.compileContentRuleList` with the rules: ``` [{ "trigger": { "url-filter": ".*", "load-type": "thirdparty" }, "action": { "type": "block-cookies" } }] ``` It will say `"Error Domain=WKErrorDomain Code=6 "(null)" UserInfo={NSHelpAnchor=Rule list compilation failed: Invalid trigger flags array.}"` Because the `load-type` is set to `thirdparty` for `block-cookies` action type. Sample application uploaded. Expected Behaviour: Should allow developers to block ThirdParty cookies using the content rules list because WKWebView's HTTPCookieStore set to `never` does NOT work.
Attachments
Example where it throws an error (32.25 KB, application/zip)
2020-02-11 06:42 PST, Brandon
no flags
Radar WebKit Bug Importer
Comment 1 2020-02-11 09:25:09 PST
Maciej Stachowiak
Comment 2 2020-02-19 02:27:00 PST
Do you specifically want to do it this way, or would a WKWebView preference to block all third-party cookies (as requested elsewhere) do the trick? (This does seem like a strange limitation. Blocking cookies for third-party loads using content blockers may be complicated by the fact that redirects can alter third-party-ness.)
Krzysztof Jan Modras [:chrmod]
Comment 3 2020-02-19 02:39:12 PST
Having a configuration option on WKWebView would work fine in Cliqz perspective. Would WKPreferences `thirdPartyCookiesEnabled` make sense?
Alex Christensen
Comment 4 2020-03-19 16:45:35 PDT
As documented in https://developer.apple.com/documentation/safariservices/creating_a_content_blocker you need to make at least two changes: "load-type": "thirdparty" needs to be changed to "load-type": ["third-party"]
Note You need to log in before you can comment on or make changes to this bug.