Skip to content

Instantly share code, notes, and snippets.

@bored-engineer
Created December 12, 2011 22:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bored-engineer/1469472 to your computer and use it in GitHub Desktop.
Save bored-engineer/1469472 to your computer and use it in GitHub Desktop.
Hook webViewDidFinishLoad via theos
#import <UIKit/UIKit.h>
%hook UIWebBrowserView
- (void)webViewDidFinishLoad: (UIWebView *)webView{
//NSLog(@"URL = %@",[webView stringByEvaluatingJavaScriptFromString:@"window.location"]);
%log;
%orig;
}
%end
@bored-engineer
Copy link
Author

MS:Warning: message not found [UIWebView webViewDidFinishLoad:]

@bulutcy
Copy link

bulutcy commented Apr 24, 2012

I tried all three of them but none of them is working. I tried hard but cannot find any solution, have you got a solution?

@bored-engineer
Copy link
Author

I never did find it.

@luc2yj
Copy link

luc2yj commented Mar 28, 2017

Have you found a solution to this problem?

We need to implement UIWebViewDelegate within the ViewController. However, I am not sure how I can get the UIWebView instance after I hook into the ViewController. e.g., webviewinstance.delegate = self has to be done.

Any ideas?

@MartinPham
Copy link

it's changed, try

- (void)webView:(UIWebView *)webView didFinishLoadForFrame:(id)arg2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment