feat(iOS WKWebView): Add mainDocumentURL to onShouldStartLoadWithRequest(#493)

* Pass mainDocumentURL to onShouldStartLoadWithRequest

* Update reference

* Update typescript types

* Update WebViewTypes.ts
This commit is contained in:
Penar Musaraj
2019-06-13 08:59:52 +02:00
committed by Thibault Malbranche
parent 178b416d1c
commit 71d1fcc675
4 changed files with 4 additions and 0 deletions
+1
View File
@@ -496,6 +496,7 @@ target
canGoBack
canGoForward
lockIdentifier
mainDocumentURL (iOS only)
navigationType
```
+1
View File
@@ -214,6 +214,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)aDecoder)
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
[event addEntriesFromDictionary: @{
@"url": (request.URL).absoluteString,
@"mainDocumentURL": (request.mainDocumentURL).absoluteString,
@"navigationType": navigationTypes[@(navigationType)]
}];
if (![self.delegate webView:self
+1
View File
@@ -721,6 +721,7 @@ static NSURLCredential* clientAuthenticationCredential;
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
[event addEntriesFromDictionary: @{
@"url": (request.URL).absoluteString,
@"mainDocumentURL": (request.mainDocumentURL).absoluteString,
@"navigationType": navigationTypes[@(navigationType)]
}];
if (![self.delegate webView:self
+1
View File
@@ -104,6 +104,7 @@ export interface WebViewNavigation extends WebViewNativeEvent {
| 'reload'
| 'formresubmit'
| 'other';
mainDocumentURL?: string;
}
export type DecelerationRateConstant = 'normal' | 'fast';