-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Private Browsing 2.0] Some trackers blocked by libnetcore aren't lis…
…ted in Privacy Report https://bugs.webkit.org/show_bug.cgi?id=260024 rdar://112243760 Reviewed by Tim Horton and Matthew Finkel. Currently, blocked tracking requests in Private Browsing mode are surfaced to Safari through the navigation delegate method `-_webView:didFailLoadDueToNetworkConnectionIntegrityWithURL:`. Safari then cross-references these URLs against another dataset of known trackers, and only shows blocked domains in the Privacy Report UI, if the tracking domain matches one on this list. When blocking CNAME-cloaked requests, this filtering means that unless the original request URL is itself a known tracker, Safari will just omit this from the UI. To fix this, we extract the host name of the endpoint that warranted blocking from libnetcore, and replace the host name of the reported URL with this name instead: for instance, if "tracker.foo.com" is a CNAME alias to "tracker.com", we'll report "tracker.com" instead of the original request, "tracker.foo.com". No new test, since this would require network request to a URL that's a CNAME alias, and which mDNSResponder would map to a known tracking domain. * Source/WebCore/PAL/PAL.xcodeproj/project.pbxproj: * Source/WebCore/PAL/pal/PlatformMac.cmake: * Source/WebCore/PAL/pal/spi/cocoa/NetworkSPI.h: Renamed from Source/WebKit/Platform/spi/Cocoa/NWSPI.h. Move this header from WebKit into PAL, so we can use it below. We also rename the file to the (slightly-less-mysterious) `NetworkSPI.h`. * Source/WebCore/platform/network/cf/ResourceError.h: (WebCore::ResourceError::blockedKnownTracker const): (WebCore::ResourceError::blockedTrackerHostName const): * Source/WebCore/platform/network/mac/ResourceErrorMac.mm: (extractBlockedTrackerHostName): Change the `m_blockedKnownTracker` flag to a string: `m_blockedTrackerHostName`. The null string represents that the request was not blocked. (WebCore::ResourceError::platformLazyInit): (failureIsDueToTrackerBlocking): Deleted. * Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp: (WebKit::NetworkResourceLoader::didFailLoading): Use the `blockedTrackerHostName()` above to replace the reported URL's host when reporting the failing URL to the UI process via `NetworkProcessProxy::DidBlockLoadToKnownTracker`. * Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm: * Source/WebKit/NetworkProcess/webrtc/NetworkRTCTCPSocketCocoa.mm: * Source/WebKit/NetworkProcess/webrtc/NetworkRTCUDPSocketCocoa.mm: * Source/WebKit/NetworkProcess/webrtc/NetworkRTCUtilitiesCocoa.h: * Source/WebKit/Platform/cocoa/WebPrivacyHelpers.mm: Change `NWSPI.h` imports to `<pal/spi/cocoa/NWSPI.h>`. * Source/WebKit/WebKit.xcodeproj/project.pbxproj: Canonical link: https://commits.webkit.org/266789@main
- Loading branch information
Showing
12 changed files
with
37 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters