]> git.saurik.com Git - cydia.git/commitdiff
Add -[CyteWebViewDelegate webView:didCommitLoadForFrame:].
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 14 Mar 2011 09:59:35 +0000 (02:59 -0700)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 14 Mar 2011 12:09:11 +0000 (05:09 -0700)
CyteKit/WebView.h
CyteKit/WebView.mm
CyteKit/WebViewController.mm
iPhonePrivate.h

index 0c96f6f2b1f86026d1b8b06fd8be458c09ca8d7b..ba2043bfe60ff9a0a0ad613b59542a187f5ca2a8 100644 (file)
@@ -62,6 +62,7 @@ enum CYWebPolicyDecision {
 - (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener;
 - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener;
 - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
+- (void) webView:(WebView *)view didCommitLoadForFrame:(WebFrame *)frame;
 - (void) webView:(WebView *)view didDecidePolicy:(CYWebPolicyDecision)decision forNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame;
 - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
 - (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
index dbd9129361ba79088a3a623a15cb27a43a5757a9..1329d4fb3c16c7179bd02267cc2f5a7bab111073 100644 (file)
@@ -198,6 +198,21 @@ static void $UIWebViewWebViewDelegate$webView$didClearWindowObject$forFrame$(UIW
         [super webView:view didClearWindowObject:window forFrame:frame];
 }
 // }}}
+// webView:didCommitLoadForFrame: (3.0+) {{{
+static void $UIWebViewWebViewDelegate$webView$didCommitLoadForFrame$(UIWebViewWebViewDelegate *self, SEL sel, WebView *view, WebFrame *frame) {
+    UIWebView *uiWebView(MSHookIvar<UIWebView *>(self, "uiWebView"));
+    if ([uiWebView respondsToSelector:@selector(webView:didCommitLoadForFrame:)])
+        [uiWebView webView:view didCommitLoadForFrame:frame];
+}
+
+- (void) webView:(WebView *)view didCommitLoadForFrame:(WebFrame *)frame {
+    id<CyteWebViewDelegate> delegate([self delegate]);
+    if ([delegate respondsToSelector:@selector(webView:didCommitLoadForFrame:)])
+        [delegate webView:view didCommitLoadForFrame:frame];
+    if ([UIWebView instancesRespondToSelector:@selector(webView:didCommitLoadForFrame:)])
+        [super webView:view didCommitLoadForFrame:frame];
+}
+// }}}
 // webView:didFailLoadWithError:forFrame: (2.0+) {{{
 - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame {
     id<CyteWebViewDelegate> delegate([self delegate]);
@@ -343,6 +358,7 @@ __attribute__((__constructor__)) static void $() {
         class_addMethod($UIWebViewWebViewDelegate, @selector(webView:addMessageToConsole:), (IMP) &$UIWebViewWebViewDelegate$webView$addMessageToConsole$, "v16@0:4@8@12");
         class_addMethod($UIWebViewWebViewDelegate, @selector(webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener:), (IMP) &$UIWebViewWebViewDelegate$webView$decidePolicyForNewWindowAction$request$newFrameName$decisionListener$, "v28@0:4@8@12@16@20@24");
         class_addMethod($UIWebViewWebViewDelegate, @selector(webView:didClearWindowObject:forFrame:), (IMP) &$UIWebViewWebViewDelegate$webView$didClearWindowObject$forFrame$, "v20@0:4@8@12@16");
+        class_addMethod($UIWebViewWebViewDelegate, @selector(webView:didCommitLoadForFrame:), (IMP) &$UIWebViewWebViewDelegate$webView$didCommitLoadForFrame$, "v16@0:4@8@12");
         class_addMethod($UIWebViewWebViewDelegate, @selector(webView:didReceiveTitle:forFrame:), (IMP) &$UIWebViewWebViewDelegate$webView$didReceiveTitle$forFrame$, "v20@0:4@8@12@16");
         class_addMethod($UIWebViewWebViewDelegate, @selector(webView:resource:willSendRequest:redirectResponse:fromDataSource:), (IMP) &$UIWebViewWebViewDelegate$webView$resource$willSendRequest$redirectResponse$fromDataSource$, "@28@0:4@8@12@16@20@24");
         class_addMethod($UIWebViewWebViewDelegate, @selector(webViewClose:), (IMP) &$UIWebViewWebViewDelegate$webViewClose$, "v12@0:4@8");
index 444e821e6e4cae03d2276e46aac58c3eba9d8f5d..c36614c2855b27ba65386ebaabdf9ca6d82f5b7e 100644 (file)
@@ -464,6 +464,15 @@ float CYScrollViewDecelerationRateNormal;
 - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame {
 }
 
+- (void) webView:(WebView *)view didCommitLoadForFrame:(WebFrame *)frame {
+#if LogBrowser
+    NSLog(@"didCommitLoadForFrame:%@", frame);
+#endif
+
+    if ([frame parentFrame] == nil) {
+    }
+}
+
 - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame {
 #if LogBrowser
     NSLog(@"didFailLoadWithError:%@ forFrame:%@", error, frame);
index b5a5959411ecf0055a6a80087b91aa134dc39f78..ed8a91f2b6817bf22b491a8276284c69f166ab9f 100644 (file)
@@ -313,6 +313,7 @@ typedef enum {
 - (void) webView:(WebView *)view decidePolicyForNavigationAction:(NSDictionary *)action request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id<WebPolicyDecisionListener>)listener;
 - (void) webView:(WebView *)view decidePolicyForNewWindowAction:(NSDictionary *)action request:(NSURLRequest *)request newFrameName:(NSString *)name decisionListener:(id<WebPolicyDecisionListener>)listener;
 - (void) webView:(WebView *)view didClearWindowObject:(WebScriptObject *)window forFrame:(WebFrame *)frame;
+- (void) webView:(WebView *)view didCommitLoadForFrame:(WebFrame *)frame;
 - (void) webView:(WebView *)view didFailLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
 - (void) webView:(WebView *)view didFailProvisionalLoadWithError:(NSError *)error forFrame:(WebFrame *)frame;
 - (void) webView:(WebView *)view didFinishLoadForFrame:(WebFrame *)frame;