@react-native-ohos/react-native-webview 13.10.5-rc.2 → 13.15.1-rc.3
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/LICENSE +1 -1
- package/README.OpenSource +11 -0
- package/README.md +2 -2
- package/harmony/rn_webview/index.ets +4 -25
- package/harmony/rn_webview/oh-package.json5 +2 -2
- package/harmony/rn_webview/src/main/cpp/WebViewPackage.h +4 -24
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/BaseReactNativeWebviewPackage.h +69 -69
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/components/RNCWebViewJSIBinder.h +109 -116
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebView.cpp +1 -3
- package/harmony/rn_webview/src/main/cpp/generated/RNOH/generated/turbo_modules/RNCWebViewModule.cpp +1 -3
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ComponentDescriptors.h +7 -5
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.cpp +231 -230
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/EventEmitters.h +250 -272
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.cpp +62 -110
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/Props.h +494 -322
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.cpp +4 -6
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/ShadowNodes.h +7 -9
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.cpp +5 -5
- package/harmony/rn_webview/src/main/cpp/generated/react/renderer/components/react_native_webview/States.h +14 -5
- package/harmony/rn_webview/src/main/ets/CutomReference.ts +3 -23
- package/harmony/rn_webview/src/main/ets/Logger.ts +3 -23
- package/harmony/rn_webview/src/main/ets/Magic.ets +3 -24
- package/harmony/rn_webview/src/main/ets/RNCWebView.ets +7 -81
- package/harmony/rn_webview/src/main/ets/RNCWebViewPackage.ets +5 -33
- package/harmony/rn_webview/src/main/ets/ShouldRequestUrl.ts +3 -23
- package/harmony/rn_webview/src/main/ets/WebViewBaseOperate.ets +3 -23
- package/harmony/rn_webview/src/main/ets/WebViewTurboModule.ets +3 -23
- package/harmony/rn_webview/src/main/ets/generated/components/RNCWebView.ts +47 -32
- package/harmony/rn_webview/ts.ets +3 -23
- package/harmony/rn_webview.har +0 -0
- package/package.json +11 -16
- package/src/NativeRNCWebView.ts +6 -0
- package/src/NativeRNCWebViewModule.ts +5 -3
- package/src/RNCWebViewNativeComponent.ts +158 -90
- package/src/WebView.harmony.tsx +17 -4
- package/src/WebView.tsx +6 -0
- package/src/codegenUtils.ts +5 -3
- package/src/index.ts +6 -0
- package/harmony/rn_webview/BuildProfile.ets +0 -41
- package/harmony/rn_webview/LICENSE +0 -21
- package/harmony/rn_webview/NOTICE +0 -33
- package/harmony/rn_webview/README.OpenSource +0 -11
- package/harmony/rn_webview/consumer-rules.txt +0 -0
- package/harmony/rn_webview/obfuscation-rules.txt +0 -18
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
6
|
+
|
|
1
7
|
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
8
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
3
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
DirectEventHandler,
|
|
11
|
+
Double,
|
|
12
|
+
Int32,
|
|
13
|
+
WithDefault,
|
|
14
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
15
|
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
5
|
-
import type { UnsafeMixed } from './codegenUtils';
|
|
6
16
|
|
|
7
17
|
export type WebViewNativeEvent = Readonly<{
|
|
8
18
|
url: string;
|
|
@@ -11,12 +21,12 @@ export type WebViewNativeEvent = Readonly<{
|
|
|
11
21
|
canGoBack: boolean;
|
|
12
22
|
canGoForward: boolean;
|
|
13
23
|
lockIdentifier: Double;
|
|
14
|
-
}
|
|
24
|
+
}>;
|
|
15
25
|
export type WebViewCustomMenuSelectionEvent = Readonly<{
|
|
16
26
|
label: string;
|
|
17
27
|
key: string;
|
|
18
28
|
selectedText: string;
|
|
19
|
-
}
|
|
29
|
+
}>;
|
|
20
30
|
export type WebViewMessageEvent = Readonly<{
|
|
21
31
|
url: string;
|
|
22
32
|
loading: boolean;
|
|
@@ -25,10 +35,10 @@ export type WebViewMessageEvent = Readonly<{
|
|
|
25
35
|
canGoForward: boolean;
|
|
26
36
|
lockIdentifier: Double;
|
|
27
37
|
data: string;
|
|
28
|
-
}
|
|
38
|
+
}>;
|
|
29
39
|
export type WebViewOpenWindowEvent = Readonly<{
|
|
30
40
|
targetUrl: string;
|
|
31
|
-
}
|
|
41
|
+
}>;
|
|
32
42
|
export type WebViewHttpErrorEvent = Readonly<{
|
|
33
43
|
url: string;
|
|
34
44
|
loading: boolean;
|
|
@@ -38,7 +48,7 @@ export type WebViewHttpErrorEvent = Readonly<{
|
|
|
38
48
|
lockIdentifier: Double;
|
|
39
49
|
description: string;
|
|
40
50
|
statusCode: Int32;
|
|
41
|
-
}
|
|
51
|
+
}>;
|
|
42
52
|
|
|
43
53
|
export type WebViewErrorEvent = Readonly<{
|
|
44
54
|
url: string;
|
|
@@ -50,9 +60,9 @@ export type WebViewErrorEvent = Readonly<{
|
|
|
50
60
|
domain?: string;
|
|
51
61
|
code: Int32;
|
|
52
62
|
description: string;
|
|
53
|
-
}
|
|
63
|
+
}>;
|
|
54
64
|
|
|
55
|
-
export type WebViewNativeProgressEvent = Readonly<
|
|
65
|
+
export type WebViewNativeProgressEvent = Readonly<{
|
|
56
66
|
url: string;
|
|
57
67
|
loading: boolean;
|
|
58
68
|
title: string;
|
|
@@ -60,9 +70,9 @@ export type WebViewNativeProgressEvent = Readonly< {
|
|
|
60
70
|
canGoForward: boolean;
|
|
61
71
|
lockIdentifier: Double;
|
|
62
72
|
progress: Double;
|
|
63
|
-
}
|
|
73
|
+
}>;
|
|
64
74
|
|
|
65
|
-
export type WebViewNavigationEvent = Readonly<
|
|
75
|
+
export type WebViewNavigationEvent = Readonly<{
|
|
66
76
|
url: string;
|
|
67
77
|
loading: boolean;
|
|
68
78
|
title: string;
|
|
@@ -77,9 +87,9 @@ export type WebViewNavigationEvent = Readonly< {
|
|
|
77
87
|
| 'formresubmit'
|
|
78
88
|
| 'other';
|
|
79
89
|
mainDocumentURL?: string;
|
|
80
|
-
}
|
|
90
|
+
}>;
|
|
81
91
|
|
|
82
|
-
export type ShouldStartLoadRequestEvent
|
|
92
|
+
export type ShouldStartLoadRequestEvent = Readonly<{
|
|
83
93
|
url: string;
|
|
84
94
|
loading: boolean;
|
|
85
95
|
title: string;
|
|
@@ -95,46 +105,46 @@ export type ShouldStartLoadRequestEvent = Readonly<{
|
|
|
95
105
|
| 'other';
|
|
96
106
|
mainDocumentURL?: string;
|
|
97
107
|
isTopFrame: boolean;
|
|
98
|
-
}
|
|
108
|
+
}>;
|
|
99
109
|
|
|
100
110
|
type ScrollEvent = Readonly<{
|
|
101
111
|
contentInset: {
|
|
102
|
-
bottom: Double
|
|
103
|
-
left: Double
|
|
104
|
-
right: Double
|
|
105
|
-
top: Double
|
|
106
|
-
}
|
|
112
|
+
bottom: Double;
|
|
113
|
+
left: Double;
|
|
114
|
+
right: Double;
|
|
115
|
+
top: Double;
|
|
116
|
+
};
|
|
107
117
|
contentOffset: {
|
|
108
|
-
y: Double
|
|
109
|
-
x: Double
|
|
110
|
-
}
|
|
118
|
+
y: Double;
|
|
119
|
+
x: Double;
|
|
120
|
+
};
|
|
111
121
|
contentSize: {
|
|
112
|
-
height: Double
|
|
113
|
-
width: Double
|
|
114
|
-
}
|
|
122
|
+
height: Double;
|
|
123
|
+
width: Double;
|
|
124
|
+
};
|
|
115
125
|
layoutMeasurement: {
|
|
116
|
-
height: Double
|
|
117
|
-
width: Double
|
|
118
|
-
}
|
|
126
|
+
height: Double;
|
|
127
|
+
width: Double;
|
|
128
|
+
};
|
|
119
129
|
targetContentOffset?: {
|
|
120
|
-
y: Double
|
|
121
|
-
x: Double
|
|
122
|
-
}
|
|
130
|
+
y: Double;
|
|
131
|
+
x: Double;
|
|
132
|
+
};
|
|
123
133
|
velocity?: {
|
|
124
|
-
y: Double
|
|
125
|
-
x: Double
|
|
126
|
-
}
|
|
127
|
-
zoomScale?: Double
|
|
128
|
-
responderIgnoreScroll?: boolean
|
|
129
|
-
}
|
|
134
|
+
y: Double;
|
|
135
|
+
x: Double;
|
|
136
|
+
};
|
|
137
|
+
zoomScale?: Double;
|
|
138
|
+
responderIgnoreScroll?: boolean;
|
|
139
|
+
}>;
|
|
130
140
|
|
|
131
141
|
type WebViewRenderProcessGoneEvent = Readonly<{
|
|
132
142
|
didCrash: boolean;
|
|
133
|
-
}
|
|
143
|
+
}>;
|
|
134
144
|
|
|
135
145
|
type WebViewDownloadEvent = Readonly<{
|
|
136
146
|
downloadUrl: string;
|
|
137
|
-
}
|
|
147
|
+
}>;
|
|
138
148
|
|
|
139
149
|
// type MenuItem = Readonly<{label: string, key: string}>;
|
|
140
150
|
|
|
@@ -144,11 +154,17 @@ export interface NativeProps extends ViewProps {
|
|
|
144
154
|
allowsProtectedMedia?: boolean;
|
|
145
155
|
allowsFullscreenVideo?: boolean;
|
|
146
156
|
androidLayerType?: WithDefault<'none' | 'software' | 'hardware', 'none'>;
|
|
147
|
-
cacheMode?: WithDefault<
|
|
157
|
+
cacheMode?: WithDefault<
|
|
158
|
+
| 'LOAD_DEFAULT'
|
|
159
|
+
| 'LOAD_CACHE_ELSE_NETWORK'
|
|
160
|
+
| 'LOAD_NO_CACHE'
|
|
161
|
+
| 'LOAD_CACHE_ONLY',
|
|
162
|
+
'LOAD_DEFAULT'
|
|
163
|
+
>;
|
|
148
164
|
domStorageEnabled?: boolean;
|
|
149
165
|
downloadingMessage?: string;
|
|
150
166
|
forceDarkOn?: boolean;
|
|
151
|
-
geolocationEnabled?:
|
|
167
|
+
geolocationEnabled?: boolean;
|
|
152
168
|
lackPermissionToDownloadMessage?: string;
|
|
153
169
|
messagingModuleName: string;
|
|
154
170
|
minimumFontSize?: Int32;
|
|
@@ -158,82 +174,108 @@ export interface NativeProps extends ViewProps {
|
|
|
158
174
|
onRenderProcessGone?: DirectEventHandler<WebViewRenderProcessGoneEvent>;
|
|
159
175
|
overScrollMode?: string;
|
|
160
176
|
saveFormDataDisabled?: boolean;
|
|
161
|
-
scalesPageToFit?: boolean
|
|
162
|
-
setBuiltInZoomControls?: boolean
|
|
177
|
+
scalesPageToFit?: WithDefault<boolean, true>;
|
|
178
|
+
setBuiltInZoomControls?: WithDefault<boolean, true>;
|
|
163
179
|
setDisplayZoomControls?: boolean;
|
|
164
|
-
setSupportMultipleWindows?: boolean
|
|
180
|
+
setSupportMultipleWindows?: WithDefault<boolean, true>;
|
|
165
181
|
textZoom?: Int32;
|
|
166
|
-
thirdPartyCookiesEnabled?: boolean
|
|
182
|
+
thirdPartyCookiesEnabled?: WithDefault<boolean, true>;
|
|
167
183
|
// Workaround to watch if listener if defined
|
|
168
184
|
hasOnScroll?: boolean;
|
|
169
185
|
injectedJavaScriptObject?: string;
|
|
170
186
|
// !Android only
|
|
171
|
-
|
|
187
|
+
paymentRequestEnabled?: boolean;
|
|
172
188
|
// iOS only
|
|
173
189
|
allowingReadAccessToURL?: string;
|
|
174
190
|
allowsBackForwardNavigationGestures?: boolean;
|
|
175
191
|
allowsInlineMediaPlayback?: boolean;
|
|
192
|
+
allowsPictureInPictureMediaPlayback?: boolean;
|
|
176
193
|
allowsAirPlayForMediaPlayback?: boolean;
|
|
177
|
-
allowsLinkPreview?: boolean
|
|
178
|
-
automaticallyAdjustContentInsets?: boolean
|
|
194
|
+
allowsLinkPreview?: WithDefault<boolean, true>;
|
|
195
|
+
automaticallyAdjustContentInsets?: WithDefault<boolean, true>;
|
|
179
196
|
ignoreSilentHardwareSwitch?:boolean;
|
|
180
|
-
autoManageStatusBarEnabled?: boolean
|
|
181
|
-
bounces?: boolean
|
|
182
|
-
contentInset?:
|
|
197
|
+
autoManageStatusBarEnabled?: WithDefault<boolean, true>;
|
|
198
|
+
bounces?: WithDefault<boolean, true>;
|
|
199
|
+
contentInset?: Readonly<{
|
|
183
200
|
top?: Double;
|
|
184
201
|
left?: Double;
|
|
185
202
|
bottom?: Double;
|
|
186
203
|
right?: Double;
|
|
187
|
-
}
|
|
188
|
-
contentInsetAdjustmentBehavior?: WithDefault<
|
|
189
|
-
|
|
204
|
+
}>;
|
|
205
|
+
contentInsetAdjustmentBehavior?: WithDefault<
|
|
206
|
+
'never' | 'automatic' | 'scrollableAxes' | 'always',
|
|
207
|
+
'never'
|
|
208
|
+
>;
|
|
209
|
+
contentMode?: WithDefault<
|
|
210
|
+
'recommended' | 'mobile' | 'desktop',
|
|
211
|
+
'recommended'
|
|
212
|
+
>;
|
|
190
213
|
dataDetectorTypes?: WithDefault<
|
|
191
|
-
|
|
192
|
-
|
|
214
|
+
ReadonlyArray<
|
|
215
|
+
| 'address'
|
|
216
|
+
| 'link'
|
|
217
|
+
| 'calendarEvent'
|
|
218
|
+
| 'trackingNumber'
|
|
219
|
+
| 'flightNumber'
|
|
220
|
+
| 'lookupSuggestion'
|
|
221
|
+
| 'phoneNumber'
|
|
222
|
+
| 'all'
|
|
223
|
+
| 'none'
|
|
224
|
+
>,
|
|
193
225
|
'phoneNumber'
|
|
194
226
|
>;
|
|
195
227
|
decelerationRate?: Double;
|
|
196
|
-
directionalLockEnabled?: boolean
|
|
228
|
+
directionalLockEnabled?: WithDefault<boolean, true>;
|
|
197
229
|
enableApplePay?: boolean;
|
|
198
230
|
hideKeyboardAccessoryView?: boolean;
|
|
199
|
-
keyboardDisplayRequiresUserAction?: boolean
|
|
231
|
+
keyboardDisplayRequiresUserAction?: WithDefault<boolean, true>;
|
|
200
232
|
limitsNavigationsToAppBoundDomains?: boolean;
|
|
201
|
-
mediaCapturePermissionGrantType?: WithDefault<
|
|
233
|
+
mediaCapturePermissionGrantType?: WithDefault<
|
|
234
|
+
| 'prompt'
|
|
235
|
+
| 'grant'
|
|
236
|
+
| 'deny'
|
|
237
|
+
| 'grantIfSameHostElsePrompt'
|
|
238
|
+
| 'grantIfSameHostElseDeny',
|
|
239
|
+
'prompt'
|
|
240
|
+
>;
|
|
202
241
|
pagingEnabled?: boolean;
|
|
203
242
|
pullToRefreshEnabled?: boolean;
|
|
204
|
-
|
|
243
|
+
refreshControlLightMode?: boolean;
|
|
244
|
+
scrollEnabled?: WithDefault<boolean, true>;
|
|
205
245
|
sharedCookiesEnabled?: boolean;
|
|
206
|
-
textInteractionEnabled?: boolean
|
|
207
|
-
useSharedProcessPool?: boolean
|
|
246
|
+
textInteractionEnabled?: WithDefault<boolean, true>;
|
|
247
|
+
useSharedProcessPool?: WithDefault<boolean, true>;
|
|
208
248
|
onContentProcessDidTerminate?: DirectEventHandler<WebViewNativeEvent>;
|
|
209
249
|
onCustomMenuSelection?: DirectEventHandler<WebViewCustomMenuSelectionEvent>;
|
|
210
250
|
onFileDownload?: DirectEventHandler<WebViewDownloadEvent>;
|
|
211
|
-
|
|
212
|
-
menuItems?:
|
|
213
|
-
suppressMenuItems?:
|
|
251
|
+
|
|
252
|
+
menuItems?: ReadonlyArray<Readonly<{ label: string; key: string }>>;
|
|
253
|
+
suppressMenuItems?: Readonly<string>[];
|
|
214
254
|
// Workaround to watch if listener if defined
|
|
215
255
|
hasOnFileDownload?: boolean;
|
|
216
|
-
fraudulentWebsiteWarningEnabled?: boolean
|
|
217
|
-
|
|
256
|
+
fraudulentWebsiteWarningEnabled?: WithDefault<boolean, true>;
|
|
218
257
|
// !iOS only
|
|
219
258
|
|
|
220
259
|
allowFileAccessFromFileURLs?: boolean;
|
|
221
260
|
allowUniversalAccessFromFileURLs?: boolean;
|
|
222
261
|
applicationNameForUserAgent?: string;
|
|
223
|
-
basicAuthCredential?:
|
|
262
|
+
basicAuthCredential?: Readonly<{
|
|
224
263
|
username: string;
|
|
225
264
|
password: string;
|
|
226
|
-
}
|
|
227
|
-
cacheEnabled?: boolean
|
|
265
|
+
}>;
|
|
266
|
+
cacheEnabled?: WithDefault<boolean, true>;
|
|
228
267
|
incognito?: boolean;
|
|
229
268
|
injectedJavaScript?: string;
|
|
230
269
|
injectedJavaScriptBeforeContentLoaded?: string;
|
|
231
|
-
injectedJavaScriptForMainFrameOnly?: boolean
|
|
232
|
-
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?:
|
|
270
|
+
injectedJavaScriptForMainFrameOnly?: WithDefault<boolean, true>;
|
|
271
|
+
injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: WithDefault<
|
|
272
|
+
boolean,
|
|
273
|
+
true
|
|
274
|
+
>;
|
|
233
275
|
javaScriptCanOpenWindowsAutomatically?: boolean;
|
|
234
|
-
javaScriptEnabled?: boolean
|
|
235
|
-
webviewDebuggingEnabled?:
|
|
236
|
-
mediaPlaybackRequiresUserAction?: boolean
|
|
276
|
+
javaScriptEnabled?: WithDefault<boolean, true>;
|
|
277
|
+
webviewDebuggingEnabled?: boolean;
|
|
278
|
+
mediaPlaybackRequiresUserAction?: WithDefault<boolean, true>;
|
|
237
279
|
messagingEnabled: boolean;
|
|
238
280
|
shouldStartLoadWithRequestEnabled: boolean;
|
|
239
281
|
onLoadingError: DirectEventHandler<WebViewErrorEvent>;
|
|
@@ -246,39 +288,65 @@ export interface NativeProps extends ViewProps {
|
|
|
246
288
|
hasOnOpenWindowEvent?: boolean;
|
|
247
289
|
onScroll?: DirectEventHandler<ScrollEvent>;
|
|
248
290
|
onShouldStartLoadWithRequest: DirectEventHandler<ShouldStartLoadRequestEvent>;
|
|
249
|
-
showsHorizontalScrollIndicator?: boolean
|
|
250
|
-
showsVerticalScrollIndicator?: boolean
|
|
251
|
-
|
|
252
|
-
|
|
291
|
+
showsHorizontalScrollIndicator?: WithDefault<boolean, true>;
|
|
292
|
+
showsVerticalScrollIndicator?: WithDefault<boolean, true>;
|
|
293
|
+
indicatorStyle?: WithDefault<'default' | 'black' | 'white', 'default'>;
|
|
294
|
+
newSource: Readonly<{
|
|
295
|
+
uri?: string;
|
|
253
296
|
method?: string;
|
|
254
297
|
body?: string;
|
|
255
|
-
|
|
256
|
-
headers?:
|
|
298
|
+
|
|
299
|
+
headers?: ReadonlyArray<Readonly<{ name: string; value: string }>>;
|
|
257
300
|
html?: string;
|
|
258
301
|
baseUrl?: string;
|
|
259
|
-
}
|
|
302
|
+
}>;
|
|
260
303
|
userAgent?: string;
|
|
261
|
-
schemeList?: UnsafeMixed<ReadonlyArray<string>>;
|
|
262
304
|
}
|
|
263
305
|
|
|
264
306
|
export interface NativeCommands {
|
|
265
|
-
goBack: (viewRef: React.ElementRef<HostComponent<NativeProps>>
|
|
307
|
+
goBack: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
266
308
|
goForward: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
267
309
|
reload: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
268
310
|
stopLoading: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
269
|
-
injectJavaScript: (
|
|
311
|
+
injectJavaScript: (
|
|
312
|
+
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
313
|
+
javascript: string
|
|
314
|
+
) => void;
|
|
270
315
|
requestFocus: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
271
|
-
postMessage: (
|
|
316
|
+
postMessage: (
|
|
317
|
+
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
318
|
+
data: string
|
|
319
|
+
) => void;
|
|
272
320
|
// Android Only
|
|
273
|
-
loadUrl: (
|
|
274
|
-
|
|
275
|
-
|
|
321
|
+
loadUrl: (
|
|
322
|
+
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
323
|
+
url: string
|
|
324
|
+
) => void;
|
|
325
|
+
clearFormData: (
|
|
326
|
+
viewRef: React.ElementRef<HostComponent<NativeProps>>
|
|
327
|
+
) => void;
|
|
328
|
+
clearCache: (
|
|
329
|
+
viewRef: React.ElementRef<HostComponent<NativeProps>>,
|
|
330
|
+
includeDiskFiles: boolean
|
|
331
|
+
) => void;
|
|
276
332
|
clearHistory: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
|
|
277
333
|
// !Android Only
|
|
278
334
|
}
|
|
279
335
|
|
|
280
336
|
export const Commands = codegenNativeCommands<NativeCommands>({
|
|
281
|
-
supportedCommands: [
|
|
337
|
+
supportedCommands: [
|
|
338
|
+
'goBack',
|
|
339
|
+
'goForward',
|
|
340
|
+
'reload',
|
|
341
|
+
'stopLoading',
|
|
342
|
+
'injectJavaScript',
|
|
343
|
+
'requestFocus',
|
|
344
|
+
'postMessage',
|
|
345
|
+
'loadUrl',
|
|
346
|
+
'clearFormData',
|
|
347
|
+
'clearCache',
|
|
348
|
+
'clearHistory',
|
|
349
|
+
],
|
|
282
350
|
});
|
|
283
351
|
|
|
284
352
|
export default codegenNativeComponent<NativeProps>(
|
package/src/WebView.harmony.tsx
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
4
6
|
|
|
5
7
|
import React, {
|
|
6
8
|
forwardRef,
|
|
@@ -64,13 +66,14 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps & { scalesPageToFit: boo
|
|
|
64
66
|
textInteractionEnabled = true,
|
|
65
67
|
injectedJavaScript,
|
|
66
68
|
injectedJavaScriptBeforeContentLoaded,
|
|
69
|
+
injectedJavaScriptObject,
|
|
67
70
|
menuItems=[],
|
|
68
71
|
injectedJavaScriptForMainFrameOnly = true,
|
|
69
72
|
injectedJavaScriptBeforeContentLoadedForMainFrameOnly = true,
|
|
70
73
|
thirdPartyCookiesEnabled = false,
|
|
71
74
|
geolocationEnabled = false,
|
|
72
75
|
webviewDebuggingEnabled = false,
|
|
73
|
-
|
|
76
|
+
paymentRequestEnabled = false,
|
|
74
77
|
startInLoadingState,
|
|
75
78
|
onNavigationStateChange,
|
|
76
79
|
onLoadStart,
|
|
@@ -92,6 +95,7 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps & { scalesPageToFit: boo
|
|
|
92
95
|
source,
|
|
93
96
|
nativeConfig,
|
|
94
97
|
allowsInlineMediaPlayback,
|
|
98
|
+
allowsPictureInPictureMediaPlayback,
|
|
95
99
|
allowsAirPlayForMediaPlayback,
|
|
96
100
|
mediaPlaybackRequiresUserAction=true,
|
|
97
101
|
dataDetectorTypes,
|
|
@@ -101,6 +105,7 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps & { scalesPageToFit: boo
|
|
|
101
105
|
onStartShouldSetResponder,
|
|
102
106
|
onMoveShouldSetResponderCapture,
|
|
103
107
|
pullToRefreshEnabled=false,
|
|
108
|
+
refreshControlLightMode=false,
|
|
104
109
|
onResponderMove,
|
|
105
110
|
...otherProps
|
|
106
111
|
},
|
|
@@ -148,6 +153,7 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps & { scalesPageToFit: boo
|
|
|
148
153
|
startInLoadingState,
|
|
149
154
|
originWhitelist,
|
|
150
155
|
ignoreSilentHardwareSwitch,
|
|
156
|
+
allowsPictureInPictureMediaPlayback,
|
|
151
157
|
minimumFontSize,
|
|
152
158
|
onShouldStartLoadWithRequestProp,
|
|
153
159
|
onShouldStartLoadWithRequestCallback,
|
|
@@ -185,6 +191,10 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps & { scalesPageToFit: boo
|
|
|
185
191
|
);
|
|
186
192
|
|
|
187
193
|
useWarnIfChanges(allowsInlineMediaPlayback, 'allowsInlineMediaPlayback');
|
|
194
|
+
useWarnIfChanges(
|
|
195
|
+
allowsPictureInPictureMediaPlayback,
|
|
196
|
+
'allowsPictureInPictureMediaPlayback'
|
|
197
|
+
);
|
|
188
198
|
useWarnIfChanges(
|
|
189
199
|
allowsAirPlayForMediaPlayback,
|
|
190
200
|
'allowsAirPlayForMediaPlayback'
|
|
@@ -278,6 +288,7 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps & { scalesPageToFit: boo
|
|
|
278
288
|
onContentProcessDidTerminate={onContentProcessDidTerminate}
|
|
279
289
|
thirdPartyCookiesEnabled={thirdPartyCookiesEnabled}
|
|
280
290
|
pullToRefreshEnabled={pullToRefreshEnabled}
|
|
291
|
+
refreshControlLightMode={refreshControlLightMode}
|
|
281
292
|
injectedJavaScript={injectedJavaScript}
|
|
282
293
|
injectedJavaScriptBeforeContentLoaded={
|
|
283
294
|
injectedJavaScriptBeforeContentLoaded
|
|
@@ -293,6 +304,7 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps & { scalesPageToFit: boo
|
|
|
293
304
|
: [dataDetectorTypes]
|
|
294
305
|
}
|
|
295
306
|
allowsAirPlayForMediaPlayback={allowsAirPlayForMediaPlayback}
|
|
307
|
+
allowsPictureInPictureMediaPlayback={allowsPictureInPictureMediaPlayback}
|
|
296
308
|
allowsInlineMediaPlayback={allowsInlineMediaPlayback}
|
|
297
309
|
incognito={incognito}
|
|
298
310
|
mediaPlaybackRequiresUserAction={mediaPlaybackRequiresUserAction}
|
|
@@ -300,6 +312,7 @@ const WebViewComponent = forwardRef<{}, IOSWebViewProps & { scalesPageToFit: boo
|
|
|
300
312
|
newSource={newSource}
|
|
301
313
|
style={webViewStyles}
|
|
302
314
|
webviewDebuggingEnabled={webviewDebuggingEnabled}
|
|
315
|
+
paymentRequestEnabled={paymentRequestEnabled}
|
|
303
316
|
hasOnFileDownload={!!onFileDownload}
|
|
304
317
|
ref={webViewRef}
|
|
305
318
|
// @ts-expect-error old arch only
|
package/src/WebView.tsx
CHANGED
package/src/codegenUtils.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2025 Huawei Device Co., Ltd. All rights reserved
|
|
3
|
+
* Use of this source code is governed by a MIT license that can be
|
|
4
|
+
* found in the LICENSE file.
|
|
5
|
+
*/
|
|
4
6
|
|
|
5
7
|
export type UnsafeMixed<T> = T;
|
|
6
8
|
|
package/src/index.ts
CHANGED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MIT License
|
|
3
|
-
*
|
|
4
|
-
* Copyright (C) 2025 Huawei Device Co., Ltd.
|
|
5
|
-
*
|
|
6
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
8
|
-
* in the Software without restriction, including without limitation the rights
|
|
9
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
11
|
-
* furnished to do so, subject to the following conditions:
|
|
12
|
-
*
|
|
13
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
14
|
-
* copies or substantial portions of the Software.
|
|
15
|
-
*
|
|
16
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
-
* SOFTWARE.
|
|
23
|
-
*/
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Use these variables when you tailor your ArkTS code. They must be of the const type.
|
|
27
|
-
*/
|
|
28
|
-
export const HAR_VERSION = '13.10.4-rc.4';
|
|
29
|
-
export const BUILD_MODE_NAME = 'debug';
|
|
30
|
-
export const DEBUG = true;
|
|
31
|
-
export const TARGET_NAME = 'default';
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* BuildProfile Class is used only for compatibility purposes.
|
|
35
|
-
*/
|
|
36
|
-
export default class BuildProfile {
|
|
37
|
-
static readonly HAR_VERSION = HAR_VERSION;
|
|
38
|
-
static readonly BUILD_MODE_NAME = BUILD_MODE_NAME;
|
|
39
|
-
static readonly DEBUG = DEBUG;
|
|
40
|
-
static readonly TARGET_NAME = TARGET_NAME;
|
|
41
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2015-present, Facebook, Inc.
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
OPEN SOURCE SOFTWARE NOTICE
|
|
2
|
-
|
|
3
|
-
Please note we provide an open source software notice for the third party open source software along with this software and/or this software component (in the following just “this SOFTWARE”). The open source software licenses are granted by the respective right holders.
|
|
4
|
-
|
|
5
|
-
Warranty Disclaimer
|
|
6
|
-
THE OPEN SOURCE SOFTWARE IN THIS PRODUCT IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. SEE THE APPLICABLE LICENSES FOR MORE DETAILS.
|
|
7
|
-
|
|
8
|
-
Copyright Notice and License Texts
|
|
9
|
-
|
|
10
|
-
----------------------------------------------------------------------
|
|
11
|
-
Software: react-native-webview v13.6.2
|
|
12
|
-
|
|
13
|
-
MIT License
|
|
14
|
-
|
|
15
|
-
Copyright (c) 2015-present, Facebook, Inc.
|
|
16
|
-
|
|
17
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
18
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
19
|
-
in the Software without restriction, including without limitation the rights
|
|
20
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
21
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
22
|
-
furnished to do so, subject to the following conditions:
|
|
23
|
-
|
|
24
|
-
The above copyright notice and this permission notice shall be included in all
|
|
25
|
-
copies or substantial portions of the Software.
|
|
26
|
-
|
|
27
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
28
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
29
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
30
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
31
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
32
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
|
-
SOFTWARE.
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
[
|
|
2
|
-
{
|
|
3
|
-
"Name": "react-native-webview",
|
|
4
|
-
"License": "MIT License",
|
|
5
|
-
"License File": "https://github.com/react-native-webview/react-native-webview/blob/master/LICENSE",
|
|
6
|
-
"Version Number": "13.6.2",
|
|
7
|
-
"Owner" : "Jamon Holmgren <jamon@infinite.red>"
|
|
8
|
-
"Upstream URL": "https://github.com/react-native-webview/react-native-webview",
|
|
9
|
-
"Description": "React Native WebView component for iOS, Android, macOS, and Windows"
|
|
10
|
-
}
|
|
11
|
-
]
|
|
File without changes
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
# Define project specific obfuscation rules here.
|
|
2
|
-
# You can include the obfuscation configuration files in the current module's build-profile.json5.
|
|
3
|
-
#
|
|
4
|
-
# For more details, see
|
|
5
|
-
# https://gitee.com/openharmony/arkcompiler_ets_frontend/blob/master/arkguard/README.md
|
|
6
|
-
|
|
7
|
-
# Obfuscation options:
|
|
8
|
-
# -disable-obfuscation: disable all obfuscations
|
|
9
|
-
# -enable-property-obfuscation: obfuscate the property names
|
|
10
|
-
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
|
|
11
|
-
# -compact: remove unnecessary blank spaces and all line feeds
|
|
12
|
-
# -remove-log: remove all console.* statements
|
|
13
|
-
# -print-namecache: print the name cache that contains the mapping from the old names to new names
|
|
14
|
-
# -apply-namecache: reuse the given cache file
|
|
15
|
-
|
|
16
|
-
# Keep options:
|
|
17
|
-
# -keep-property-name: specifies property names that you want to keep
|
|
18
|
-
# -keep-global-name: specifies names that you want to keep in the global scope
|