summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Freeman (saurik) <saurik@saurik.com>2011-03-25 01:45:43 -0700
committerJay Freeman (saurik) <saurik@saurik.com>2011-03-25 01:45:43 -0700
commit0986566373b389953093642941090ae200bcd6b6 (patch)
tree121545584e369a810ca88e018786d94218898738
parent3cf380678a801294f8fae45b4594682dce224165 (diff)
Add -[CyteWebView request] helper.
-rw-r--r--CyteKit/WebView.h1
-rw-r--r--CyteKit/WebView.mm5
2 files changed, 6 insertions, 0 deletions
diff --git a/CyteKit/WebView.h b/CyteKit/WebView.h
index c7eeb4b..c9e10c8 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 09c9c40..1706cc0 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) {