Source/WebKit/ChangeLog

 12022-02-22 J Pascoe <j_pascoe@apple.com>
 2
 3 Prevent use of PDFKit when using PDF.js
 4 https://bugs.webkit.org/show_bug.cgi?id=237052
 5 rdar://89251696
 6
 7 Reviewed by NOBODY (OOPS!).
 8
 9 PDFKit was still being used by embeds, this patch fixes that issue by treating
 10 pdf embeds as frames if PDF.js is enabled and also prevents the loading of
 11 the PDFKit plugin entirely by modifying shouldUsePDFPlugin.
 12
 13 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
 14 (WebKit::WebFrameLoaderClient::objectContentType):
 15 * WebProcess/WebPage/mac/WebPageMac.mm:
 16 (WebKit::WebPage::shouldUsePDFPlugin const):
 17
1182022-02-22 J Pascoe <j_pascoe@apple.com>
219
320 [WebAuthn] Fix lifetime issue on iOS

Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp

@@ObjectContentType WebFrameLoaderClient::objectContentType(const URL& url, const
17041704 return ObjectContentType::Frame;
17051705 }
17061706 }
 1707 if (auto* webPage = m_frame->page()) {
 1708 if (webPage->corePage()->settings().pdfJSViewerEnabled() && MIMETypeRegistry::isPDFOrPostScriptMIMEType(mimeType))
 1709 return ObjectContentType::Frame;
 1710 }
17071711
17081712 if (MIMETypeRegistry::isSupportedImageMIMEType(mimeType))
17091713 return ObjectContentType::Image;

Source/WebKit/WebProcess/WebPage/mac/WebPageMac.mm

@@NSObject *WebPage::accessibilityObjectForMainFramePlugin()
206206bool WebPage::shouldUsePDFPlugin(const String& contentType, StringView path) const
207207{
208208 return pdfPluginEnabled()
 209 && !corePage()->settings().pdfJSViewerEnabled()
209210 && getPDFLayerControllerClass()
210211 && (MIMETypeRegistry::isPDFOrPostScriptMIMEType(contentType)
211212 || (contentType.isEmpty()