mirror of
https://github.com/status-im/react-native-webview.git
synced 2026-08-31 03:31:05 +00:00
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:
committed by
Thibault Malbranche
parent
178b416d1c
commit
71d1fcc675
@@ -496,6 +496,7 @@ target
|
||||
canGoBack
|
||||
canGoForward
|
||||
lockIdentifier
|
||||
mainDocumentURL (iOS only)
|
||||
navigationType
|
||||
```
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -104,6 +104,7 @@ export interface WebViewNavigation extends WebViewNativeEvent {
|
||||
| 'reload'
|
||||
| 'formresubmit'
|
||||
| 'other';
|
||||
mainDocumentURL?: string;
|
||||
}
|
||||
|
||||
export type DecelerationRateConstant = 'normal' | 'fast';
|
||||
|
||||
Reference in New Issue
Block a user