WebViewJavascriptBridge: I get crash in iOS11 .....
‘Completion handler passed to -[WKWebViewJavascriptBridge webView:decidePolicyForNavigationAction:decisionHandler:] was not called’
reason: ‘Completion handler passed to -[WKWebViewJavascriptBridge webView:decidePolicyForNavigationAction:decisionHandler:] was called more than once’
How to resolve this problem ?? thank you .
WVJB Bug Report
Thanks for reporting an issue with WebViewJavascriptBridge.
Do these 4 things and I will fix your problem!
- Go to https://github.com/marcuswestin/WebViewJavascriptBridge and click Fork.
- Clone your fork,
cdinto it and runmake test. All tests should pass! - Edit
Tests/WebViewJavascriptBridgeTests/BridgeTests.mand create a new, failing test which demostrates your issue. - Create a pull request for https://github.com/marcuswestin/WebViewJavascriptBridge
That’s it!
I will take it from there and promise that I’ll fix your problem ASAP.
If you don’t do this then I can’t help you!
And I probably won’t 😃
Cheers, @marcuswestin
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 41 (2 by maintainers)
Commits related to this issue
- fix iOS11 bug #302 — committed to wenxp/WebViewJavascriptBridge by deleted user 7 years ago
maybe you can add this:
if ([_base isWebViewJavascriptBridgeURL:url]) { if ([_base isBridgeLoadedURL:url]) { [_base injectJavascriptFile]; } else if ([_base isQueueMessageURL:url]) { [self WKFlushMessageQueue]; } else { [_base logUnkownMessage:url]; } decisionHandler(WKNavigationActionPolicyCancel); return; // add This------- }
That`s solve my problem
See pull request, adding return will work for me.
In WKWebViewJavascriptBridge ,I modify
------------------ 原始邮件 ------------------ 发件人: “BeyondChao”;notifications@github.com; 发送时间: 2017年9月21日(星期四) 中午1:59 收件人: "marcuswestin/WebViewJavascriptBridge"WebViewJavascriptBridge@noreply.github.com; 抄送: "呵呵哒"3190171489@qq.com; "Comment"comment@noreply.github.com; 主题: Re: [marcuswestin/WebViewJavascriptBridge] I get crash in iOS11 …(#302)
t need modify WebViewJavascriptBridges source code. decisionHandler(WKNavigationActionPolicyAllow); }That`s solve my problem
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
It gave me a great help, thanks