Authored by gaoqiang xu

合并test分支的内容

@@ -108,6 +108,14 @@ @@ -108,6 +108,14 @@
108 * @param params 参数 108 * @param params 参数
109 */ 109 */
110 - (void)explorerDidDetectParameters:(NSDictionary * _Nonnull)params; 110 - (void)explorerDidDetectParameters:(NSDictionary * _Nonnull)params;
  111 +/**
  112 + @brief 将要加载请求前的回调
  113 +
  114 + @param request 请求
  115 +
  116 + @since 1.0.7
  117 + */
  118 +- (void)explorerWillLoadRequest:(NSMutableURLRequest * _Nonnull)request;
111 119
112 /** 120 /**
113 @brief 补充userAgent 121 @brief 补充userAgent
@@ -206,7 +206,11 @@ static float kprogressViewRadius = 2.0f; @@ -206,7 +206,11 @@ static float kprogressViewRadius = 2.0f;
206 - (void)loadWebUrl:(NSString *)url 206 - (void)loadWebUrl:(NSString *)url
207 { 207 {
208 self.startPage = url; 208 self.startPage = url;
209 - [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]]; 209 + NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
  210 + if ([self.delegate respondsToSelector:@selector(explorerWillLoadRequest:)]) {
  211 + [self.delegate explorerWillLoadRequest:request];
  212 + }
  213 + [self.webView loadRequest:request];
210 } 214 }
211 215
212 - (void)loadHTMLString:(NSString *)html 216 - (void)loadHTMLString:(NSString *)html