[webkit-changes] [WebKit/WebKit] e58872: REGRESSION (255315 at main): "Save X images" and "Pri...

Aditya Keerthi noreply at github.com
Mon Apr 24 15:22:52 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e58872ac97a7585fabb9210ee35e5e5166287626
      https://github.com/WebKit/WebKit/commit/e58872ac97a7585fabb9210ee35e5e5166287626
  Author: Aditya Keerthi <akeerthi at apple.com>
  Date:   2023-04-24 (Mon, 24 Apr 2023)

  Changed paths:
    A Source/WebKit/Platform/spi/Cocoa/LinkPresentationSPI.h
    M Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj

  Log Message:
  -----------
  REGRESSION (255315 at main): "Save X images" and "Print" options are missing when sharing image files using Web Share
https://bugs.webkit.org/show_bug.cgi?id=255641
rdar://108242255

Reviewed by Wenson Hsieh.

255315 at main made the behavior change to display document icons rather than
thumbnail previews when files are shared using the Web Share API, as part of
IPC hardening.

To achieve this behavior, a placeholder URL using a `UIActivityItemProvider`
was provided, rather than the actual file URL. However, a URL with empty data
does not provide the Share Sheet with enough information to display the right
set of actions for the file. Additionally, file size information is also lost.

To fix, provide placeholder `NSData` and a type identifier, rather than a
placeholder URL, so that Share Sheet has the information necessary to display
the correct actions. Additionally, generate `LPLinkMetadata` using the original
URL to ensure the Share Sheet header is correctly populated.

* Source/WebKit/Platform/spi/Cocoa/LinkPresentationSPI.h: Added.
* Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm:
(-[WKShareSheetFileItemProvider initWithURL:]):

Provide empty `NSData` rather than a placeholder URL so that Share Sheet
requests a type identifier for the file.

Use `-[LPMetadataProvider setShouldFetchSubresources:]` to fetch metadata for
the header, without generating a thumbnail preview.

(-[WKShareSheetFileItemProvider activityViewController:dataTypeIdentifierForActivityType:]):

Provide a type identifier for the file.

(-[WKShareSheetFileItemProvider activityViewControllerLinkMetadata:]):
(-[WKShareSheetURLItemProvider initWithURL:]):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:

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




More information about the webkit-changes mailing list