Skip to content

Conversation

@wrlqwe
Copy link
Contributor

@wrlqwe wrlqwe commented Jul 24, 2017

in the latest version in [WKWebViewJavascriptBridge webView:decidePolicyForNavigationAction:decisionHandler:], after decisionHander executed:

    if ([_base isWebViewJavascriptBridgeURL:url]) {
        if ([_base isBridgeLoadedURL:url]) {
            [_base injectJavascriptFile];
        } else if ([_base isQueueMessageURL:url]) {
            [self WKFlushMessageQueue];
        } else {
            [_base logUnkownMessage:url];
        }
        decisionHandler(WKNavigationActionPolicyCancel);
    }

decisionHandler passed to _webViewDelegate and the delegate method may call decisionHandler again, most conditions it work well, but it leads crash on my iOS11+XCode9 beta environment.
In my view, a decision cannot be made for twice, the decisionHandler that consumed should not pass out side of this method, I hope this commit can fix it.

@wrlqwe
Copy link
Contributor Author

wrlqwe commented Jul 24, 2017

please review my code, I'm not sure this commit meets the requirements for repo users or is it good enough...

@marcuswestin
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants