Skip to content

Commit

Permalink
add shouldStartLoadWithRequest method to WebEventDelegate
Browse files Browse the repository at this point in the history
  • Loading branch information
duwen committed Dec 12, 2017
1 parent 0795f54 commit 9721207
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dsbridge/DUIwebview.m
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ -(instancetype)initWithFrame:(CGRect)frame

-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
return YES;
if([WebEventDelegate respondsToSelector:NSSelectorFromString(@"shouldStartLoadWithRequest::")]){
return [WebEventDelegate shouldStartLoadWithRequest:request :navigationType];
}else{
return YES;
}
}

- (void)webView:(UIWebView *)webView didCreateJavaScriptContext:(JSContext *)ctx
Expand Down
1 change: 1 addition & 0 deletions dsbridge/JSBWebEventDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ CF_ASSUME_NONNULL_BEGIN
- (void) onPageStart:(NSString *)url;
- (void) onpageFinished:(NSString *)url;
- (void) onpageError:(NSString *)url :(NSString *) msg;
- (BOOL) shouldStartLoadWithRequest:(NSURLRequest *)request :(UIWebViewNavigationType)navigationType;
@end
CF_ASSUME_NONNULL_END

0 comments on commit 9721207

Please sign in to comment.