Authored by ZhangTonghai

增加代理方法获取网页链接

review by chrsit
... ... @@ -149,5 +149,14 @@
*/
- (void)didGetMessageFromWeb:(NSDictionary * _Nonnull)params completion:(void (^ _Nonnull) (NSDictionary * _Nullable, BOOL))completion;
/**
由于shouldStartLoadWithRequest这个代理方法不适合对外暴露,此代理将暴露webview拦截到的请求
@param webView UIWebView
@param request 网页请求
@param navigationType 请求类型
*/
- (void)webView:(UIWebView *)webView didCatchRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType;
@required
@end
... ...
... ... @@ -354,6 +354,10 @@ static float kprogressViewRadius = 2.0f;
return NO;
}
if ([self.delegate respondsToSelector:@selector(webView:didCatchRequest:navigationType:)]) {
[self.delegate webView:theWebView didCatchRequest:request navigationType:navigationType];
}
BOOL b = [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
if (self.delegate && [self.delegate respondsToSelector:@selector(webView:shouldStartLoadWithRequest:navigationType:)]) {
... ...