Bug 220190 - NSCrossWebsiteTrackingUsageDescription is not working on Mac, ITP is always enabled
Summary: NSCrossWebsiteTrackingUsageDescription is not working on Mac, ITP is always e...
Status: REOPENED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Major
Assignee: Kate Cheney
URL:
Keywords: InRadar
: 220199 (view as bug list)
Depends on: 220440
Blocks:
  Show dependency treegraph
 
Reported: 2020-12-28 23:01 PST by Dan
Modified: 2021-01-07 15:23 PST (History)
10 users (show)

See Also:


Attachments
Patch (2.29 KB, patch)
2021-01-05 13:38 PST, Kate Cheney
no flags Details | Formatted Diff | Diff
Patch (3.29 KB, patch)
2021-01-05 13:53 PST, Kate Cheney
no flags Details | Formatted Diff | Diff
Patch for landing (3.28 KB, patch)
2021-01-05 17:53 PST, Kate Cheney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dan 2020-12-28 23:01:20 PST
We use WKWebView for Mac, and with the Big Sur update ITP became enabled by default and is breaking valid auth scenarios that depend on cookies in an iframe. We would like to be able to disable ITP, but adding NSCrossWebsiteTrackingUsageDescription to the info.plist is not all that is necessary.  TCCAccessPreflight(getkTCCServiceWebKitIntelligentTrackingPrevention(), nullptr) check is also performed. For iOS this is controlled by a toggle in the application OS provided settings (defaults to ITP enabled), but on Mac there does not seem to be an equivalent. I have looked through UI and documentation but have not been able to find where a Mac user can allow third-party cookies after adding NSCrossWebsiteTrackingUsageDescription to the plist. We are not a browser application, but are required to use WKWebView to render web content due to app store policies. We would like control over this ITP setting in our app which is breaking compatibility.
Comment 1 Radar WebKit Bug Importer 2020-12-30 15:59:13 PST
<rdar://problem/72744909>
Comment 2 Kate Cheney 2021-01-05 13:38:30 PST
Created attachment 417032 [details]
Patch
Comment 3 Brent Fulgham 2021-01-05 13:44:19 PST
Comment on attachment 417032 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=417032&action=review

> Source/WebKit/Shared/Cocoa/DefaultWebBrowserChecks.mm:115
> +#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) || PLATFORM(MACCATALYST)

Stylechecker is reminding us " Misplaced OS version check. Please use a named macro in one of headers in the wtf/Platform."

Could you do the extra work to add a new PlatformUse.h entry?

#if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 140000) || PLATFORM(MACCATALYST)
#define USE_ITP_TCC_CHECK 1
#endif

Then we would just do:

#if USE(ITP_TCC_CHECK)
#else
#endif
Comment 4 Kate Cheney 2021-01-05 13:53:08 PST
Created attachment 417034 [details]
Patch
Comment 5 Brent Fulgham 2021-01-05 14:12:40 PST
Comment on attachment 417034 [details]
Patch

r=me
Comment 6 EWS 2021-01-05 17:09:07 PST
Found 1 new test failure: imported/w3c/web-platform-tests/html/semantics/document-metadata/the-meta-element/pragma-directives/attr-meta-http-equiv-refresh/parsing.html
Comment 7 Kate Cheney 2021-01-05 17:11:17 PST
This test failure seems flaky and unrelated, trying cq+ again.
Comment 8 Kate Cheney 2021-01-05 17:53:43 PST
Created attachment 417063 [details]
Patch for landing
Comment 9 EWS 2021-01-05 21:30:05 PST
Committed r271192: <https://trac.webkit.org/changeset/271192>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 417063 [details].
Comment 10 Kate Cheney 2021-01-06 10:12:03 PST
*** Bug 220199 has been marked as a duplicate of this bug. ***
Comment 11 WebKit Commit Bot 2021-01-07 15:23:03 PST
Re-opened since this is blocked by bug 220440