|
@@ -128,7 +128,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
}
|
|
}
|
|
NSLog(@"111 :第一次加载:%@",url);
|
|
NSLog(@"111 :第一次加载:%@",url);
|
|
url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
|
url = [url stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
|
|
-
|
|
|
|
|
|
+
|
|
kMainQueue(^{
|
|
kMainQueue(^{
|
|
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
[self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:url]]];
|
|
})
|
|
})
|
|
@@ -362,7 +362,6 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
|
- (void)webView:(WKWebView *)webView decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler {
|
|
// 获取完整url并进行UTF-8转码
|
|
// 获取完整url并进行UTF-8转码
|
|
NSString *strRequest = [navigationAction.request.URL.absoluteString stringByRemovingPercentEncoding];
|
|
NSString *strRequest = [navigationAction.request.URL.absoluteString stringByRemovingPercentEncoding];
|
|
- NSLog(@"监测拦截的url:%@",strRequest);
|
|
|
|
if ([strRequest containsString:@"jyapp/article/content"]) {
|
|
if ([strRequest containsString:@"jyapp/article/content"]) {
|
|
NSLog(@"拦截的链接:%@",strRequest);
|
|
NSLog(@"拦截的链接:%@",strRequest);
|
|
if (![strRequest containsString:kHost]) {
|
|
if (![strRequest containsString:kHost]) {
|
|
@@ -458,17 +457,8 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
// Do any additional setup after loading the view.
|
|
// Do any additional setup after loading the view.
|
|
NSLog(@"首页初始化");
|
|
NSLog(@"首页初始化");
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
-// [self initNSURLProtocol];
|
|
|
|
- /* 取得Library文件夹的位置*/
|
|
|
|
- NSString *libraryDir = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,NSUserDomainMask, YES)[0];
|
|
|
|
- /* 取得bundle id,用作文件拼接用*/
|
|
|
|
- NSString *bundleId = [[[NSBundle mainBundle] infoDictionary]objectForKey:@"CFBundleIdentifier"];
|
|
|
|
- /*
|
|
|
|
- * 拼接缓存地址,具体目录为App/Library/Caches/你的APPBundleID/fsCachedData
|
|
|
|
- */
|
|
|
|
- NSString *webKitFolderInCachesfs = [NSString stringWithFormat:@"%@/Caches/%@/fsCachedData",libraryDir,bundleId];
|
|
|
|
|
|
|
|
- NSLog(@"webKitfile:%@",webKitFolderInCachesfs)
|
|
|
|
|
|
+ [self initNSURLProtocol];
|
|
|
|
|
|
[self.view addSubview:self.webView];
|
|
[self.view addSubview:self.webView];
|
|
[self.view addSubview:self.progressView];
|
|
[self.view addSubview:self.progressView];
|
|
@@ -559,12 +549,11 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
//正常的网页加载
|
|
//正常的网页加载
|
|
[self judgeIsHidden];//是否隐藏
|
|
[self judgeIsHidden];//是否隐藏
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
|
|
[self removeNoNetViews];
|
|
[self removeNoNetViews];
|
|
|
|
|
|
[self isExitCallToJS:@"afterPageInit()" withMethodName:@"afterPageInit"];
|
|
[self isExitCallToJS:@"afterPageInit()" withMethodName:@"afterPageInit"];
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
/* 页面开始加载 */
|
|
/* 页面开始加载 */
|
|
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|
|
- (void)webView:(WKWebView *)webView didStartProvisionalNavigation:(WKNavigation *)navigation{
|