Summary: | WKContentRuleList rules does not allow you to block ThirdParty cookies | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Brandon <bthomas> | ||||
Component: | WebKit API | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED INVALID | ||||||
Severity: | Enhancement | CC: | achristensen, beidson, krzysztof.modras, mjs, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | iPhone / iPad | ||||||
OS: | iOS 13 | ||||||
Attachments: |
|
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.) Having a configuration option on WKWebView would work fine in Cliqz perspective. Would WKPreferences `thirdPartyCookiesEnabled` make sense? 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"] |
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.