Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: ccf8724c8c3407cb21486abe4b0c0437c8b5d31b
      
https://github.com/WebKit/WebKit/commit/ccf8724c8c3407cb21486abe4b0c0437c8b5d31b
  Author: Wenson Hsieh <[email protected]>
  Date:   2023-08-18 (Fri, 18 Aug 2023)

  Changed paths:
    M Source/WebCore/PAL/pal/cocoa/WebPrivacySoftLink.h
    M Source/WebCore/PAL/pal/cocoa/WebPrivacySoftLink.mm
    M Source/WebKit/Platform/cocoa/WebPrivacyHelpers.mm

  Log Message:
  -----------
  Remote list updates for link decoration filtering fail in Safari 17
https://bugs.webkit.org/show_bug.cgi?id=260391
rdar://114047664

Reviewed by Tim Horton.

On macOS Monterey (but not macOS Ventura or later), calling:

```
dlopen("/System/Library/PrivateFrameworks/WebPrivacy.framework/WebPrivacy", 
RTLD_NOW);
```

...fails to load WebPrivacy.framework from the Safari staged framework 
directory. This causes
`PAL::isWebPrivacyFrameworkAvailable()` to return `false`, which in turn breaks 
link decoration
filtering when advanced privacy protections are enabled. In comparison, the 
main built-in tracker
blocker loaded by Safari actually *successfully* loads, because we only use 
`objc_getClass` to look
up `WPResources`, and don't depend on a successful `dlopen`.

On downlevels, this call to `dlopen` is actually unnecessary, since we already 
link WebPrivacy via
`-weak_framework`; as such, it's sufficient to simply check whether any one of 
the framework API
classes (e.g. `WPResources`) have been loaded.

* Source/WebCore/PAL/pal/cocoa/WebPrivacySoftLink.h:
* Source/WebCore/PAL/pal/cocoa/WebPrivacySoftLink.mm:
* Source/WebKit/Platform/cocoa/WebPrivacyHelpers.mm:

Also, remove unnecessary soft link helpers for `WPNetworkAddressRange` (we 
don't need this because
we never need to create one of these in WebKit).

(WebKit::canUseWebPrivacyFramework):
(WebKit::resourceDataChangedNotificationName):
(WebKit::notificationUserInfoResourceTypeKey):
(-[WKWebPrivacyNotificationListener init]):
(-[WKWebPrivacyNotificationListener dealloc]):
(-[WKWebPrivacyNotificationListener didUpdate:]):
(WebKit::LinkDecorationFilteringController::updateStrings):
(WebKit::requestLinkDecorationFilteringData):
(WebKit::TrackerAddressLookupInfo::populateIfNeeded):
(WebKit::TrackerDomainLookupInfo::populateIfNeeded):

Canonical link: https://commits.webkit.org/267051@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to