[Webkit-unassigned] [Bug 213600] New: WKURLSchemeHandler caught in loading loop

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 25 07:40:24 PDT 2020


https://bugs.webkit.org/show_bug.cgi?id=213600

            Bug ID: 213600
           Summary: WKURLSchemeHandler caught in loading loop
           Product: WebKit
           Version: Other
          Hardware: iPhone / iPad
                OS: iOS 13
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mikel.elorz at virtual-solution.com

Created attachment 402730

  --> https://bugs.webkit.org/attachment.cgi?id=402730&action=review

Sample Xcode iOS project where issue is reproducible

On an iOS application, WKWebView can be forced to register http and https protocols:

WKWebViewConfiguration *configuration = [[WKWebViewConfiguration alloc] init];
[configuration setURLSchemeHandler:self forURLScheme:@"http"];
[configuration setURLSchemeHandler:self forURLScheme:@"https"];
self.webView = [[WKWebView alloc] initWithFrame:self.view.frame configuration:configuration];

by overriding the default behaviour with a category:

@interface WKWebView (URLScheme)
@end
@implementation WKWebView (URLScheme)
+ (BOOL)handlesURLScheme:(NSString *)scheme {
    return NO;
}
@end

When doing that, all requests can be intercepted and most websites work but there are some that get caught in a loop where the same URL is tried to be loaded again and again (-webView:startURLSchemeTask: is called indefinitely with the same URL).
Detected cases until now:
- https://thelocal.de
- https://twitter.com/login (after inputting credentials)

Attached can be found a simple Xcode project where the issue can be seen.


P.S.: I know this is not how you are supposed to use WKURLSchemeHandler but, sadly, this is the only way that has worked so far for the development of our app in which we are forced to intercept all WKWebView traffic.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20200625/1fda17b1/attachment.htm>


More information about the webkit-unassigned mailing list