Skip to content
Permalink
Browse files
Only support downloading previews in captive portal mode
https://bugs.webkit.org/show_bug.cgi?id=241741
<rdar://92037537>

Reviewed by Brent Fulgham.

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForResponseShared):
Set policy for previews to download

Canonical link: https://commits.webkit.org/251700@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@295695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
pascoej committed Jun 21, 2022
1 parent 90c722c commit f270225
Showing 1 changed file with 7 additions and 2 deletions.
@@ -320,6 +320,10 @@
#import <WebCore/ScreenCaptureKitSharingSessionManager.h>
#endif

#if USE(QUICK_LOOK)
#include <WebCore/PreviewConverter.h>
#endif

#define MESSAGE_CHECK(process, assertion) MESSAGE_CHECK_BASE(assertion, process->connection())
#define MESSAGE_CHECK_URL(process, url) MESSAGE_CHECK_BASE(checkURLReceivedFromCurrentOrPreviousWebProcess(process, url), process->connection())
#define MESSAGE_CHECK_COMPLETION(process, assertion, completion) MESSAGE_CHECK_COMPLETION_BASE(assertion, process->connection(), completion)
@@ -5833,9 +5837,10 @@ void WebPageProxy::decidePolicyForResponseShared(Ref<WebProcessProxy>&& process,
#endif
), webPageID);
});
if (process->captivePortalMode() == WebProcessProxy::CaptivePortalMode::Enabled && MIMETypeRegistry::isPDFOrPostScriptMIMEType(navigationResponse->response().mimeType()))
#if USE(QUICK_LOOK)
if (process->captivePortalMode() == WebProcessProxy::CaptivePortalMode::Enabled && (MIMETypeRegistry::isPDFOrPostScriptMIMEType(navigationResponse->response().mimeType()) || PreviewConverter::supportsMIMEType(navigationResponse->response().mimeType())))
policyAction = PolicyAction::Download;
#endif
receivedPolicyDecision(policyAction, navigation.get(), nullptr, WTFMove(navigationResponse), WTFMove(sender));
}, ShouldExpectSafeBrowsingResult::No, ShouldExpectAppBoundDomainResult::No);

0 comments on commit f270225

Please sign in to comment.