react-native-webview-bootpay 13.13.47 → 13.13.48
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.
|
@@ -302,9 +302,17 @@ public class BPCWebView extends WebView implements LifecycleEventListener {
|
|
|
302
302
|
|
|
303
303
|
private void injectJavascriptObject() {
|
|
304
304
|
if (getSettings().getJavaScriptEnabled()) {
|
|
305
|
+
// iOS와 동일하게 postMessage 함수를 명시적으로 정의
|
|
306
|
+
// WebViewCompat.addWebMessageListener가 주입한 원본 postMessage를 보존하면서
|
|
307
|
+
// injectedObjectJson 등 추가 기능 제공
|
|
305
308
|
String js = "(function(){\n" +
|
|
309
|
+
" var existing = window." + JAVASCRIPT_INTERFACE + ";\n" +
|
|
310
|
+
" var originalPostMessage = existing ? existing.postMessage : null;\n" +
|
|
306
311
|
" window." + JAVASCRIPT_INTERFACE + " = window." + JAVASCRIPT_INTERFACE + " || {};\n" +
|
|
307
312
|
" window." + JAVASCRIPT_INTERFACE + ".injectedObjectJson = function () { return " + (injectedJavaScriptObject == null ? null : ("`" + injectedJavaScriptObject + "`")) + "; };\n" +
|
|
313
|
+
" if (originalPostMessage) {\n" +
|
|
314
|
+
" window." + JAVASCRIPT_INTERFACE + ".postMessage = originalPostMessage;\n" +
|
|
315
|
+
" }\n" +
|
|
308
316
|
"})();";
|
|
309
317
|
evaluateJavascriptWithFallback(js);
|
|
310
318
|
}
|
|
@@ -471,9 +479,15 @@ public class BPCWebView extends WebView implements LifecycleEventListener {
|
|
|
471
479
|
* - window[JAVASCRIPT_INTERFACE].postMessage
|
|
472
480
|
*/
|
|
473
481
|
@JavascriptInterface
|
|
474
|
-
public void postMessage(String message) {
|
|
482
|
+
public void postMessage(final String message) {
|
|
475
483
|
if (mWebView.getMessagingEnabled()) {
|
|
476
|
-
|
|
484
|
+
// WebView methods must be called on the main (UI) thread
|
|
485
|
+
mWebView.post(new Runnable() {
|
|
486
|
+
@Override
|
|
487
|
+
public void run() {
|
|
488
|
+
mWebView.onMessage(message, mWebView.getUrl());
|
|
489
|
+
}
|
|
490
|
+
});
|
|
477
491
|
} else {
|
|
478
492
|
FLog.w(TAG, "ReactNativeWebView.postMessage method was called but messaging is disabled. Pass an onMessage handler to the WebView.");
|
|
479
493
|
}
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"Thibault Malbranche <malbranche.thibault@gmail.com>"
|
|
11
11
|
],
|
|
12
12
|
"license": "MIT",
|
|
13
|
-
"version": "13.13.
|
|
13
|
+
"version": "13.13.48",
|
|
14
14
|
"homepage": "https://github.com/react-native-webview/react-native-webview#readme",
|
|
15
15
|
"scripts": {
|
|
16
16
|
"android": "react-native run-android",
|
|
@@ -41,33 +41,33 @@
|
|
|
41
41
|
"invariant": "2.2.4"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"@babel/cli": "^7.
|
|
45
|
-
"@babel/core": "^7.
|
|
46
|
-
"@babel/runtime": "^7.
|
|
47
|
-
"@callstack/react-native-visionos": "0.
|
|
48
|
-
"@react-native/babel-preset": "0.
|
|
49
|
-
"@react-native/eslint-config": "0.
|
|
50
|
-
"@react-native/metro-config": "0.
|
|
51
|
-
"@react-native/typescript-config": "0.
|
|
52
|
-
"@rnx-kit/metro-config": "
|
|
53
|
-
"@semantic-release/git": "
|
|
54
|
-
"@types/invariant": "^2.2.
|
|
55
|
-
"@types/jest": "^29.5.
|
|
56
|
-
"@types/react": "18.
|
|
57
|
-
"@types/selenium-webdriver": "4.
|
|
58
|
-
"appium": "
|
|
59
|
-
"eslint": "8.57.
|
|
60
|
-
"jest": "^29.
|
|
61
|
-
"prettier": "
|
|
62
|
-
"react": "18.
|
|
63
|
-
"react-native": "0.
|
|
64
|
-
"react-native-macos": "0.
|
|
65
|
-
"react-native-test-app": "3.7
|
|
66
|
-
"react-native-windows": "0.
|
|
44
|
+
"@babel/cli": "^7.26.0",
|
|
45
|
+
"@babel/core": "^7.26.0",
|
|
46
|
+
"@babel/runtime": "^7.26.0",
|
|
47
|
+
"@callstack/react-native-visionos": "0.76.7",
|
|
48
|
+
"@react-native/babel-preset": "0.76.7",
|
|
49
|
+
"@react-native/eslint-config": "0.76.7",
|
|
50
|
+
"@react-native/metro-config": "0.76.7",
|
|
51
|
+
"@react-native/typescript-config": "0.76.7",
|
|
52
|
+
"@rnx-kit/metro-config": "2.2.0",
|
|
53
|
+
"@semantic-release/git": "10.0.1",
|
|
54
|
+
"@types/invariant": "^2.2.37",
|
|
55
|
+
"@types/jest": "^29.5.14",
|
|
56
|
+
"@types/react": "18.3.18",
|
|
57
|
+
"@types/selenium-webdriver": "4.1.28",
|
|
58
|
+
"appium": "2.15.0",
|
|
59
|
+
"eslint": "8.57.1",
|
|
60
|
+
"jest": "^29.7.0",
|
|
61
|
+
"prettier": "3.4.2",
|
|
62
|
+
"react": "18.3.1",
|
|
63
|
+
"react-native": "0.76.7",
|
|
64
|
+
"react-native-macos": "0.76.7",
|
|
65
|
+
"react-native-test-app": "3.11.7",
|
|
66
|
+
"react-native-windows": "0.76.7",
|
|
67
67
|
"selenium-appium": "1.0.2",
|
|
68
|
-
"selenium-webdriver": "4.
|
|
69
|
-
"semantic-release": "
|
|
70
|
-
"typescript": "5.
|
|
68
|
+
"selenium-webdriver": "4.27.0",
|
|
69
|
+
"semantic-release": "24.2.1",
|
|
70
|
+
"typescript": "5.6.3",
|
|
71
71
|
"winappdriver": "^0.0.7"
|
|
72
72
|
},
|
|
73
73
|
"repository": {
|