Title: [289753] branches/safari-613-branch/Source
Revision
289753
Author
[email protected]
Date
2022-02-14 12:49:40 -0800 (Mon, 14 Feb 2022)

Log Message

Cherry-pick r289658. rdar://problem/88678598

    Regression(r287684) Microsoft teams meeting URLs fail to open the app
    https://bugs.webkit.org/show_bug.cgi?id=236516
    <rdar://88678598>

    Reviewed by Geoffrey Garen.

    Add a quirk for Microsoft teams.

    Source/WebCore:

    * page/Quirks.cpp:
    (WebCore::Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture):
    * page/Quirks.h:

    Source/WebKit:

    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::decidePolicyForNavigationAction):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289658 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613-branch/Source/WebCore/ChangeLog (289752 => 289753)


--- branches/safari-613-branch/Source/WebCore/ChangeLog	2022-02-14 20:29:39 UTC (rev 289752)
+++ branches/safari-613-branch/Source/WebCore/ChangeLog	2022-02-14 20:49:40 UTC (rev 289753)
@@ -1,3 +1,43 @@
+2022-02-14  Russell Epstein  <[email protected]>
+
+        Cherry-pick r289658. rdar://problem/88678598
+
+    Regression(r287684) Microsoft teams meeting URLs fail to open the app
+    https://bugs.webkit.org/show_bug.cgi?id=236516
+    <rdar://88678598>
+    
+    Reviewed by Geoffrey Garen.
+    
+    Add a quirk for Microsoft teams.
+    
+    Source/WebCore:
+    
+    * page/Quirks.cpp:
+    (WebCore::Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture):
+    * page/Quirks.h:
+    
+    Source/WebKit:
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-11  Chris Dumez  <[email protected]>
+
+            Regression(r287684) Microsoft teams meeting URLs fail to open the app
+            https://bugs.webkit.org/show_bug.cgi?id=236516
+            <rdar://88678598>
+
+            Reviewed by Geoffrey Garen.
+
+            Add a quirk for Microsoft teams.
+
+            * page/Quirks.cpp:
+            (WebCore::Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture):
+            * page/Quirks.h:
+
 2022-02-10  Alan Coon  <[email protected]>
 
         Cherry-pick r288434. rdar://problem/56436745

Modified: branches/safari-613-branch/Source/WebCore/page/Quirks.cpp (289752 => 289753)


--- branches/safari-613-branch/Source/WebCore/page/Quirks.cpp	2022-02-14 20:29:39 UTC (rev 289752)
+++ branches/safari-613-branch/Source/WebCore/page/Quirks.cpp	2022-02-14 20:49:40 UTC (rev 289753)
@@ -1420,6 +1420,11 @@
 #endif
 }
 
+bool Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture(StringView protocol, const SecurityOriginData& requesterOrigin)
+{
+    return protocol == "msteams" && requesterOrigin.host == "teams.live.com";
+}
+
 #if ENABLE(IMAGE_ANALYSIS)
 
 bool Quirks::needsToForceUserSelectAndUserDragWhenInstallingImageOverlay() const

Modified: branches/safari-613-branch/Source/WebCore/page/Quirks.h (289752 => 289753)


--- branches/safari-613-branch/Source/WebCore/page/Quirks.h	2022-02-14 20:29:39 UTC (rev 289752)
+++ branches/safari-613-branch/Source/WebCore/page/Quirks.h	2022-02-14 20:49:40 UTC (rev 289753)
@@ -38,6 +38,7 @@
 class HTMLVideoElement;
 class LayoutUnit;
 class PlatformMouseEvent;
+struct SecurityOriginData;
 
 #if ENABLE(INTELLIGENT_TRACKING_PREVENTION)
 class RegistrableDomain;
@@ -93,6 +94,7 @@
     WEBCORE_EXPORT bool shouldIgnoreAriaForFastPathContentObservationCheck() const;
     WEBCORE_EXPORT bool shouldLayOutAtMinimumWindowWidthWhenIgnoringScalingConstraints() const;
     WEBCORE_EXPORT bool shouldIgnoreContentObservationForSyntheticClick(bool isFirstSyntheticClickOnPage) const;
+    WEBCORE_EXPORT static bool shouldAllowNavigationToCustomProtocolWithoutUserGesture(StringView protocol, const SecurityOriginData& requesterOrigin);
 
     WEBCORE_EXPORT bool needsYouTubeMouseOutQuirk() const;
     

Modified: branches/safari-613-branch/Source/WebKit/ChangeLog (289752 => 289753)


--- branches/safari-613-branch/Source/WebKit/ChangeLog	2022-02-14 20:29:39 UTC (rev 289752)
+++ branches/safari-613-branch/Source/WebKit/ChangeLog	2022-02-14 20:49:40 UTC (rev 289753)
@@ -1,3 +1,42 @@
+2022-02-14  Russell Epstein  <[email protected]>
+
+        Cherry-pick r289658. rdar://problem/88678598
+
+    Regression(r287684) Microsoft teams meeting URLs fail to open the app
+    https://bugs.webkit.org/show_bug.cgi?id=236516
+    <rdar://88678598>
+    
+    Reviewed by Geoffrey Garen.
+    
+    Add a quirk for Microsoft teams.
+    
+    Source/WebCore:
+    
+    * page/Quirks.cpp:
+    (WebCore::Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture):
+    * page/Quirks.h:
+    
+    Source/WebKit:
+    
+    * UIProcess/WebPageProxy.cpp:
+    (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289658 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-11  Chris Dumez  <[email protected]>
+
+            Regression(r287684) Microsoft teams meeting URLs fail to open the app
+            https://bugs.webkit.org/show_bug.cgi?id=236516
+            <rdar://88678598>
+
+            Reviewed by Geoffrey Garen.
+
+            Add a quirk for Microsoft teams.
+
+            * UIProcess/WebPageProxy.cpp:
+            (WebKit::WebPageProxy::decidePolicyForNavigationAction):
+
 2022-02-08  Russell Epstein  <[email protected]>
 
         Cherry-pick r288090. rdar://problem/87601499

Modified: branches/safari-613-branch/Source/WebKit/UIProcess/WebPageProxy.cpp (289752 => 289753)


--- branches/safari-613-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-02-14 20:29:39 UTC (rev 289752)
+++ branches/safari-613-branch/Source/WebKit/UIProcess/WebPageProxy.cpp	2022-02-14 20:49:40 UTC (rev 289753)
@@ -5412,9 +5412,12 @@
     // Sandboxed iframes should be allowed to open external apps via custom protocols unless explicitely allowed (https://html.spec.whatwg.org/#hand-off-to-external-software).
     bool canHandleRequest = navigationActionData.canHandleRequest || m_urlSchemeHandlersByScheme.contains(request.url().protocol().toStringWithoutCopying());
     if (!canHandleRequest && !destinationFrameInfo->isMainFrame() && !frameSandboxAllowsOpeningExternalCustomProtocols(navigationActionData.effectiveSandboxFlags, !!navigationActionData.userGestureTokenIdentifier)) {
-        WEBPAGEPROXY_RELEASE_LOG_ERROR(Process, "Ignoring request to load this main resource because it has a custom protocol and comes from a sandboxed iframe");
-        process->send(Messages::WebPage::AddConsoleMessage(frame.frameID(), MessageSource::Security, MessageLevel::Error, "Ignoring request to load this main resource because it has a custom protocol and comes from a sandboxed iframe"_s, std::nullopt), webPageID);
-        return receivedPolicyDecision(PolicyAction::Ignore, m_navigationState->navigation(navigationID), nullptr, WTFMove(navigationAction), WTFMove(sender));
+        if (!sourceFrameInfo || !m_preferences->needsSiteSpecificQuirks() || !Quirks::shouldAllowNavigationToCustomProtocolWithoutUserGesture(request.url().protocol(), sourceFrameInfo->securityOrigin())) {
+            WEBPAGEPROXY_RELEASE_LOG_ERROR(Process, "Ignoring request to load this main resource because it has a custom protocol and comes from a sandboxed iframe");
+            process->send(Messages::WebPage::AddConsoleMessage(frame.frameID(), MessageSource::Security, MessageLevel::Error, "Ignoring request to load this main resource because it has a custom protocol and comes from a sandboxed iframe"_s, std::nullopt), webPageID);
+            return receivedPolicyDecision(PolicyAction::Ignore, m_navigationState->navigation(navigationID), nullptr, WTFMove(navigationAction), WTFMove(sender));
+        }
+        process->send(Messages::WebPage::AddConsoleMessage(frame.frameID(), MessageSource::Security, MessageLevel::Warning, "In the future, requests to navigate to a URL with custom protocol from a sandboxed iframe will be ignored"_s, std::nullopt), webPageID);
     }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to