karosLi / KKJSBridge

一站式解决 WKWebView 支持离线包,Ajax/Fetch 请求,表单请求和 Cookie 同步的问题 (基于 Ajax Hook,Fetch Hook 和 Cookie Hook)
MIT License
693 stars 120 forks source link

开启ajax拦截,但是回调函数里面获取不到结果 #6

Closed ZhangKejun closed 4 years ago

ZhangKejun commented 4 years ago

var ajaxUrl = "https://xxxx"; $.ajax({ url: ajaxUrl, type: "POST", success: function(data) { console.log(data); // 此行不进来,获取不到回调数据 } });

控制台拦截日志: 2019-12-27 11:37:43.145636+0800 KKJSBridgeDemo[26649:467666] KKJSBridge Receive ajax.open: { "method" : "POST", "scheme" : "http:", "port" : "50000", "id" : 993, "async" : true, "href" : "http:\/\/127.0.0.1:50000\/index", "host" : "127.0.0.1", "referer" : null, "useragent" : "Mozilla\/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) AppleWebKit\/605.1.15 (KHTML, like Gecko) Mobile\/16A366 KKJSBridge\/1.0.0", "url" : "https:\/\/xxxx" } 2019-12-27 11:37:43.146043+0800 KKJSBridgeDemo[26649:467676] KKJSBridge Receive ajax.setRequestHeader: { "id" : 993, "headerName" : "Accept", "headerValue" : "\/" } 2019-12-27 11:37:43.146208+0800 KKJSBridgeDemo[26649:467893] KKJSBridge Receive ajax.send: { "id" : 993 }

ZhangKejun commented 4 years ago

已经引入了