Bug 216624

Summary: Deprecate WKPageLoadURLRequestReturningNavigation
Product: WebKit Reporter: Hoa Dinh <dvh>
Component: WebKit APIAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal CC: achristensen, beidson, cdumez, darin, dvh, ews-watchlist, japhet
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch achristensen: review-, ews-feeder: commit-queue-

Description Hoa Dinh 2020-09-16 16:35:02 PDT
Using WKPageLoadURLRequestReturningNavigation() for now will call underlying WebKit:: WebPageProxy::loadRequest() with shouldOpenExternalURLsPolicy set to ShouldAllowExternalSchemes.
It won't allow opening universal links with the proper application.

Instead, WKPageLoadURLRequestReturningNavigation() should be using shouldOpenExternalURLsPolicy set to ShouldAllow.
Comment 1 Hoa Dinh 2020-09-16 22:16:56 PDT
Created attachment 408989 [details]
Patch
Comment 2 Darin Adler 2020-09-16 22:21:51 PDT
Comment on attachment 408989 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408989&action=review

> Source/WebCore/loader/FrameLoaderTypes.h:141
> +    // Don't allow external URLs.
>      ShouldNotAllow,
> +    // External schemes are allowed but App Links are not.
>      ShouldAllowExternalSchemes,
> +    // Allow external URLs.
>      ShouldAllow,

Please revise the names instead of adding comments. We want these names clear everywhere they are used, not just when reading this header.

    ShouldAllowExternalSchemesButNotAppLinks
Comment 3 Hoa Dinh 2020-09-16 23:33:22 PDT
Created attachment 408994 [details]
Patch
Comment 4 Darin Adler 2020-09-16 23:59:05 PDT
Comment on attachment 408994 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=408994&action=review

> Source/WebKit/ChangeLog:24
> +        * UIProcess/API/C/mac/WKPagePrivateMac.mm:
> +        (WKPageLoadURLRequestReturningNavigation): Allow universal links.

What’s the rationale for this? I’m not sure there’s anything in the name that makes it clear it should allow universal links. I presume this is the behavior Safari wants, but is that clear enough in the SPI contract for this function? Are there non-Safari clients who might want different behavior?
Comment 5 Alex Christensen 2020-09-17 09:37:27 PDT
Comment on attachment 408994 [details]
Patch

Safari should use WKWebView._loadRequest:shouldOpenExternalURLs: instead of this.
Comment 6 Hoa Dinh 2020-09-17 13:10:24 PDT
It's a deprecated API. It won't be fixed.