li6185377 / imywebloader Goto Github PK
View Code? Open in Web Editor NEW支持对 UIWebView/WKWebView 的资源, 进行 预加载、缓存、拦截 等操作 ... Orz
License: MIT License
支持对 UIWebView/WKWebView 的资源, 进行 预加载、缓存、拦截 等操作 ... Orz
License: MIT License
https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/getAllResponseHeaders
文档里面规定headers应该是字符串类型的,目前传到js的是一个object, 因为公司的前端项目会做headers.split所以发现了这个问题。我提个mr
IMYWebNetworkHandlerDefaultImpl
`+ (void)networkRequestThreadEntryPoint:(id)__unused object
{
@autoreleasepool {
[[NSThread currentThread] setName:@"IMYWebNetworkThread"];
NSRunLoop *runLoop = [NSRunLoop currentRunLoop];
[runLoop addPort:[NSMachPort port] forMode:NSDefaultRunLoopMode];
[runLoop run];
}
}`
[runLoop run]; 报EXC_BAD_ACCESS
快速进出页面会报Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'This task has already been stopped'
大佬,为了解决跨域的问题.公司把ajax换成了jsonp,我不是很懂js,想问一下拦截这种请求有什么好主意吗?
我在您的 demo 中直接填入我要接入的 url,发送 post请求时,requestBody 为空。我哪里理解错了吗?
我用wkwebview返回到前面的页面会重新加载,请问用这个能解决吗?
集成之后,在iOS15上会崩溃在wkloader_hookWKLoader:request这个方法里面
看demo 执行imy_installHookAjax就可以?还需要配置什么么?
想问下这份代码会出现这个崩溃堆栈吗, 没有的话是通过什么手段处理的呢
post请求能通了,但是h5页面还是显示超时,是因为给h5的回调有问题吗
pod 添加之后,什么都不做,
WKWebView load 一个页面,提示 csrf expired
但是 load 百度 首页 就不会出问题,这个有什么解决办法吗?
1、H5端上传的图片等二进制数据可以在app端拿到吗?
2、AJAX同步请求可以拦截吗?
由于httponly类型的cookie无法通过document.cookie进行读写,所以有以下2个问题
①httponly类型的cookie,如何转发给native端请求接口时使用?
②native请求接口完毕后拿到的httponly类型的cookie如何回传设置给webview?
=================================================================
Main Thread Checker: UI API called on a background thread: -[WKWebView evaluateJavaScript:completionHandler:]
PID: 86618, TID: 11993414, Thread name: (none), Queue name: NSOperationQueue 0x1c0221920 (QOS: UNSPECIFIED), QoS: 0
Backtrace:
4 IMYWebLoader 0x00000001021aba04 -[_IMYWKHookAjaxHandler requestCallback:httpCode:headers:data:] + 820
5 IMYWebLoader 0x00000001021ab5dc __41-[_IMYWKHookAjaxHandler requestWithBody:]_block_invoke + 136
6 IMYWebLoader 0x00000001021a027c __88-[IMYWebAjaxHandlerDefaultImpl startWithMethod:url:baseURL:headers:body:completedBlock:]_block_invoke + 528
7 CFNetwork 0x00000001820b2d50 + 32
8 CFNetwork 0x00000001820ca0ec + 152
9 Foundation 0x00000001824f2310 + 16
10 Foundation 0x00000001824329e4 + 72
11 Foundation 0x0000000182422620 + 848
12 libdispatch.dylib 0x000000010225d45c _dispatch_client_callout + 16
13 libdispatch.dylib 0x0000000102269b74 _dispatch_block_invoke_direct + 268
14 libdispatch.dylib 0x000000010225d45c _dispatch_client_callout + 16
15 libdispatch.dylib 0x0000000102269b74 _dispatch_block_invoke_direct + 268
16 libdispatch.dylib 0x0000000102269a34 dispatch_block_perform + 104
17 Foundation 0x00000001824f3fe8 + 376
18 libdispatch.dylib 0x000000010225d45c _dispatch_client_callout + 16
19 libdispatch.dylib 0x000000010226a800 _dispatch_continuation_pop + 592
20 libdispatch.dylib 0x000000010226909c _dispatch_async_redirect_invoke + 628
21 libdispatch.dylib 0x000000010226eb54 _dispatch_root_queue_drain + 616
22 libdispatch.dylib 0x000000010226e880 _dispatch_worker_thread3 + 136
23 libsystem_pthread.dylib 0x0000000181753130 _pthread_wqthread + 1268
24 libsystem_pthread.dylib 0x0000000181752c30 start_wqthread + 4
2017-12-06 15:22:21.031849+0800 IMYWebLoader[86618:11993414] [reports] Main Thread Checker: UI API called on a background thread: -[WKWebView evaluateJavaScript:completionHandler:]
PID: 86618, TID: 11993414, Thread name: (none), Queue name: NSOperationQueue 0x1c0221920 (QOS: UNSPECIFIED), QoS: 0
Backtrace:
4 IMYWebLoader 0x00000001021aba04 -[_IMYWKHookAjaxHandler requestCallback:httpCode:headers:data:] + 820
5 IMYWebLoader 0x00000001021ab5dc __41-[_IMYWKHookAjaxHandler requestWithBody:]_block_invoke + 136
6 IMYWebLoader 0x00000001021a027c __88-[IMYWebAjaxHandlerDefaultImpl startWithMethod:url:baseURL:headers:body:completedBlock:]_block_invoke + 528
7 CFNetwork 0x00000001820b2d50 + 32
8 CFNetwork 0x00000001820ca0ec + 152
9 Foundation 0x00000001824f2310 + 16
10 Foundation 0x00000001824329e4 + 72
11 Foundation 0x0000000182422620 + 848
12 libdispatch.dylib 0x000000010225d45c _dispatch_client_callout + 16
13 libdispatch.dylib 0x0000000102269b74 _dispatch_block_invoke_direct + 268
14 libdispatch.dylib 0x000000010225d45c _dispatch_client_callout + 16
15 libdispatch.dylib 0x0000000102269b74 _dispatch_block_invoke_direct + 268
16 libdispatch.dylib 0x0000000102269a34 dispatch_block_perform + 104
17 Foundation 0x00000001824f3fe8 + 376
18 libdispatch.dylib 0x000000010225d45c _dispatch_client_callout + 16
19 libdispatch.dylib 0x000000010226a800 _dispatch_continuation_pop + 592
20 libdispatch.dylib 0x000000010226909c _dispatch_async_redirect_invoke + 628
21 libdispatch.dylib 0x000000010226eb54 _dispatch_root_queue_drain + 616
22 libdispatch.dylib 0x000000010226e880 _dispatch_worker_thread3 + 136
23 libsystem_pthread.dylib 0x0000000181753130 _pthread_wqthread + 1268
24 libsystem_pthread.dylib 0x0000000181752c30 start_wqthread + 4
(lldb)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.