Authored by gaoqiang xu

增加一个请求处理前的回调 reviewed by 枪兵

... ... @@ -110,6 +110,15 @@
*/
- (void)explorerDidDetectParameters:(NSDictionary *)params;
/**
@brief 将要加载请求前的回调
@param request 请求
@since 1.0.7
*/
- (void)explorerWillLoadRequest:(NSMutableURLRequest *)request;
#pragma mark Native
/**
* 本地机能是否可以被触发,默认是YES
... ...
... ... @@ -211,7 +211,11 @@ static float kprogressViewRadius = 2.0f;
- (void)loadWebUrl:(NSString *)url
{
self.startPage = url;
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
if ([self.delegate respondsToSelector:@selector(explorerWillLoadRequest:)]) {
[self.delegate explorerWillLoadRequest:request];
}
[self.webView loadRequest:request];
}
- (void)loadHTMLString:(NSString *)html
... ...