Skip to content

WKWebViewJavascriptBridge should not directly call "stopLoading" of a WKWebView #176

@raxcat

Description

@raxcat

Hi there, love this project.

I am facing an issue regarding to WKWebViewJavascriptBridge.

https://github.com/marcuswestin/WebViewJavascriptBridge/blob/master/WebViewJavascriptBridge/WKWebViewJavascriptBridge.m
Line 130 made a function call:

 [webView stopLoading];

I would suggest the following instead: (Use decisionHanlder to deny/cancel requests whose scheme are "wvjbscheme")

decisionHandler(WKNavigationActionPolicyCancel);

I have compared to the WebViewJavascriptBridge. In the WebViewJavascriptBridge, UIWebViewDelegate method

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

returns NO instead of stopping the whole UIWebView.

Stop the loading of a WKWebView directly stop all pending request. Especially sites under HTTPS. Dunno why but thats what I saw.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions