From: Jay Freeman (saurik) Date: Fri, 25 Mar 2011 08:45:43 +0000 (-0700) Subject: Add -[CyteWebView request] helper. X-Git-Tag: v1.1.0%rc1~8 X-Git-Url: https://git.saurik.com/cydia.git/commitdiff_plain/0986566373b389953093642941090ae200bcd6b6 Add -[CyteWebView request] helper. --- diff --git a/CyteKit/WebView.h b/CyteKit/WebView.h index c7eeb4b7..c9e10c8f 100644 --- a/CyteKit/WebView.h +++ b/CyteKit/WebView.h @@ -84,6 +84,7 @@ enum CYWebPolicyDecision { - (void) dispatchEvent:(NSString *)event; - (void) reloadFromOrigin; - (UIScrollView *) scrollView; +- (NSURLRequest *) request; @end diff --git a/CyteKit/WebView.mm b/CyteKit/WebView.mm index 09c9c408..1706cc03 100644 --- a/CyteKit/WebView.mm +++ b/CyteKit/WebView.mm @@ -377,6 +377,11 @@ static void $UIWebViewWebViewDelegate$webViewClose$(UIWebViewWebViewDelegate *se [frame setNeedsLayout]; } +- (NSURLRequest *) request { + WebFrame *frame([[[self _documentView] webView] mainFrame]); + return [([frame provisionalDataSource] ?: [frame dataSource]) request]; +} + @end static void $UIWebViewWebViewDelegate$_clearUIWebView(UIWebViewWebViewDelegate *self, SEL sel) {