You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WBWebViewConsole is an In-App debug console for your UIWebView && WKWebView
Installation
WBWebViewConsole is available on CocoaPods. Just add the following to your project Podfile:
pod 'WBWebViewConsole', '~> 1.0'
Bugs are first fixed in master and then made available via a designated release. If you tend to live on the bleeding edge, you can use WBWebViewConsole from master with the following Podfile entry:
pod 'WBWebViewConsole', :git => 'https://github.com/Naituw/WBWebViewConsole.git'
Setup
Make your own UIWebView or WKWebView subclass, and implement all methods in WBWebView protocol
Setup JSBridge and console when WebView inits
If you are using UIWebView, inject userScript as early as possible after page loading. Otherwise, just use WKUserScript to implement.
In UIWebView's webView:shouldStartLoadWithRequest:navigationType or WKWebView's webView:decidePolicyForNavigationAction:decisionHandler
Pass the request to -[JSBridge handleWebViewRequest:] and use the return value to decide whether the navigation should start