@exodus/react-native-webview 11.26.1-exodus.27 → 11.26.1-exodus.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apple/RNCWebView.m +10 -2
- package/package.json +2 -1
package/apple/RNCWebView.m
CHANGED
|
@@ -580,6 +580,14 @@ RCTAutoInsetsProtocol>
|
|
|
580
580
|
}
|
|
581
581
|
}
|
|
582
582
|
#endif
|
|
583
|
+
|
|
584
|
+
- (NSMutableDictionary<NSString *, id> *)baseEventWithScriptMessage:(WKScriptMessage *)message {
|
|
585
|
+
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
586
|
+
NSString *messageOriginURL = message.frameInfo.request.URL.absoluteString ?: @"";
|
|
587
|
+
event[@"url"] = messageOriginURL;
|
|
588
|
+
return event;
|
|
589
|
+
}
|
|
590
|
+
|
|
583
591
|
/**
|
|
584
592
|
* This method is called whenever JavaScript running within the web view calls:
|
|
585
593
|
* - window.webkit.messageHandlers[MessageHandlerName].postMessage
|
|
@@ -589,13 +597,13 @@ RCTAutoInsetsProtocol>
|
|
|
589
597
|
{
|
|
590
598
|
if ([message.name isEqualToString:HistoryShimName]) {
|
|
591
599
|
if (_onLoadingFinish) {
|
|
592
|
-
NSMutableDictionary<NSString *, id> *event = [self
|
|
600
|
+
NSMutableDictionary<NSString *, id> *event = [self baseEventWithScriptMessage:message];
|
|
593
601
|
[event addEntriesFromDictionary: @{@"navigationType": message.body}];
|
|
594
602
|
_onLoadingFinish(event);
|
|
595
603
|
}
|
|
596
604
|
} else if ([message.name isEqualToString:MessageHandlerName]) {
|
|
597
605
|
if (_onMessage) {
|
|
598
|
-
NSMutableDictionary<NSString *, id> *event = [self
|
|
606
|
+
NSMutableDictionary<NSString *, id> *event = [self baseEventWithScriptMessage:message];
|
|
599
607
|
[event addEntriesFromDictionary: @{@"data": message.body}];
|
|
600
608
|
_onMessage(event);
|
|
601
609
|
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"Thibault Malbranche <malbranche.thibault@gmail.com>"
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "11.26.1-exodus.
|
|
12
|
+
"version": "11.26.1-exodus.29",
|
|
13
13
|
"homepage": "https://github.com/ExodusMovement/react-native-webview#readme",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"android": "react-native run-android",
|
|
@@ -71,6 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
73
|
"android",
|
|
74
|
+
"!android/.gradle",
|
|
74
75
|
"apple",
|
|
75
76
|
"ios",
|
|
76
77
|
"lib",
|