- Author: KUBOTA Yuji
- twitter: https://twitter.com/sugarlife
- email: kubota.yuji [at] gmail.com
なお、本資料に記載しているものの一部は実機確認してないので、お使いのコードを修正する前に動作確認してください :)
なお、本資料に記載しているものの一部は実機確認してないので、お使いのコードを修正する前に動作確認してください :)
| static function replaceLocalHost(str) { | |
| str = str.replace(/\/\/127\.0\.0\.1/gi, "//ipv4.fiddler"); | |
| str = str.replace(/\/\/localhost/gi, "//localhost.fiddler"); | |
| return str; | |
| } | |
| static function OnBeforeResponse(oSession: Session) { | |
| if (oSession.HostnameIs("localhost.fiddler") || oSession.HostnameIs("ipv4.fiddler")) { | |
| if (oSession.oResponse.headers.Exists("Location")) { |
| - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request | |
| navigationType:(UIWebViewNavigationType)navigationType { | |
| NSString *urlString = [[request URL] absoluteString]; | |
| if ([urlString hasPrefix:@"js:"]) { | |
| NSString *jsonString = [[[urlString componentsSeparatedByString:@"js:"] lastObject] | |
| stringByReplacingPercentEscapes]; | |
| NSData *jsonData = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; | |
| NSError *error; |