react-native-minimal-webview 0.0.0-stage → 1.0.1
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 +21 -0
- package/README.md +150 -2
- package/android/build.gradle +26 -0
- package/android/consumer-rules.pro +4 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/expo/modules/minimalwebview/Asks.kt +44 -0
- package/android/src/main/java/expo/modules/minimalwebview/DocumentEnd.kt +31 -0
- package/android/src/main/java/expo/modules/minimalwebview/Hooks.kt +487 -0
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebView.kt +507 -0
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewClients.kt +358 -0
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewModule.kt +245 -0
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewNavigation.kt +199 -0
- package/android/src/main/java/expo/modules/minimalwebview/MinimalWebViewScripts.kt +197 -0
- package/android/src/main/java/expo/modules/minimalwebview/NavigationRules.kt +113 -0
- package/android/src/main/java/expo/modules/minimalwebview/PlatformSettings.kt +303 -0
- package/android/src/main/java/expo/modules/minimalwebview/PullToRefresh.kt +76 -0
- package/android/src/main/java/expo/modules/minimalwebview/requests/Downloads.kt +259 -0
- package/android/src/main/java/expo/modules/minimalwebview/requests/FileUpload.kt +44 -0
- package/android/src/main/java/expo/modules/minimalwebview/requests/FullscreenVideo.kt +87 -0
- package/android/src/main/java/expo/modules/minimalwebview/requests/Permissions.kt +77 -0
- package/build/WebView.d.ts +96 -0
- package/build/WebView.d.ts.map +1 -0
- package/build/WebView.js +453 -0
- package/build/WebView.js.map +1 -0
- package/build/bridge/createBridge.d.ts +32 -0
- package/build/bridge/createBridge.d.ts.map +1 -0
- package/build/bridge/createBridge.js +137 -0
- package/build/bridge/createBridge.js.map +1 -0
- package/build/bridge/endpoint.d.ts +33 -0
- package/build/bridge/endpoint.d.ts.map +1 -0
- package/build/bridge/endpoint.js +105 -0
- package/build/bridge/endpoint.js.map +1 -0
- package/build/bridge/origins.d.ts +25 -0
- package/build/bridge/origins.d.ts.map +1 -0
- package/build/bridge/origins.js +59 -0
- package/build/bridge/origins.js.map +1 -0
- package/build/bridge/pageClient.generated.d.ts +3 -0
- package/build/bridge/pageClient.generated.d.ts.map +1 -0
- package/build/bridge/pageClient.generated.js +4 -0
- package/build/bridge/pageClient.generated.js.map +1 -0
- package/build/bridge/protocol.d.ts +50 -0
- package/build/bridge/protocol.d.ts.map +1 -0
- package/build/bridge/protocol.js +52 -0
- package/build/bridge/protocol.js.map +1 -0
- package/build/defaultNavigationRules.d.ts +15 -0
- package/build/defaultNavigationRules.d.ts.map +1 -0
- package/build/defaultNavigationRules.js +22 -0
- package/build/defaultNavigationRules.js.map +1 -0
- package/build/index.d.ts +31 -0
- package/build/index.d.ts.map +1 -0
- package/build/index.js +30 -0
- package/build/index.js.map +1 -0
- package/build/platform.generated.d.ts +701 -0
- package/build/platform.generated.d.ts.map +1 -0
- package/build/platform.generated.js +201 -0
- package/build/platform.generated.js.map +1 -0
- package/build/reactNativeWebViewDefaults.d.ts +21 -0
- package/build/reactNativeWebViewDefaults.d.ts.map +1 -0
- package/build/reactNativeWebViewDefaults.js +12 -0
- package/build/reactNativeWebViewDefaults.js.map +1 -0
- package/build/reactNativeWebViewMessages.d.ts +16 -0
- package/build/reactNativeWebViewMessages.d.ts.map +1 -0
- package/build/reactNativeWebViewMessages.js +24 -0
- package/build/reactNativeWebViewMessages.js.map +1 -0
- package/build/refStore.d.ts +32 -0
- package/build/refStore.d.ts.map +1 -0
- package/build/refStore.js +115 -0
- package/build/refStore.js.map +1 -0
- package/build/types.d.ts +1173 -0
- package/build/types.d.ts.map +1 -0
- package/build/types.defaults.d.ts +8 -0
- package/build/types.defaults.d.ts.map +1 -0
- package/build/types.defaults.js +17 -0
- package/build/types.defaults.js.map +1 -0
- package/build/types.js +2 -0
- package/build/types.js.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/Asks.swift +45 -0
- package/ios/DelegateProxy.swift +158 -0
- package/ios/DocumentEnd.swift +22 -0
- package/ios/DownloadName.swift +10 -0
- package/ios/Downloads.swift +51 -0
- package/ios/Hooks.swift +310 -0
- package/ios/Loads.swift +44 -0
- package/ios/MRWExceptions.h +9 -0
- package/ios/MRWExceptions.m +10 -0
- package/ios/MRWInvoke.h +38 -0
- package/ios/MRWInvoke.m +187 -0
- package/ios/MinimalWebView+Dialogs.swift +96 -0
- package/ios/MinimalWebView+Navigation.swift +243 -0
- package/ios/MinimalWebView+Scripts.swift +92 -0
- package/ios/MinimalWebView.docc/MinimalWebView.md +13 -0
- package/ios/MinimalWebView.podspec +32 -0
- package/ios/MinimalWebView.swift +513 -0
- package/ios/MinimalWebViewModule.swift +110 -0
- package/ios/NavigationRules.swift +123 -0
- package/ios/OriginRules.swift +36 -0
- package/ios/PlatformCompletions.generated.swift +39 -0
- package/ios/PlatformSettings.swift +252 -0
- package/ios/ReadAccess.swift +19 -0
- package/ios/Recovery.swift +25 -0
- package/ios/SharedCookies.swift +59 -0
- package/package.json +99 -4
- package/src/WebView.tsx +626 -0
- package/src/bridge/createBridge.ts +178 -0
- package/src/bridge/endpoint.ts +123 -0
- package/src/bridge/origins.ts +61 -0
- package/src/bridge/pageClient.generated.ts +5 -0
- package/src/bridge/pageClient.ts +67 -0
- package/src/bridge/protocol.ts +78 -0
- package/src/defaultNavigationRules.ts +24 -0
- package/src/index.ts +37 -0
- package/src/platform.generated.ts +693 -0
- package/src/reactNativeWebViewDefaults.ts +13 -0
- package/src/reactNativeWebViewMessages.ts +26 -0
- package/src/refStore.ts +165 -0
- package/src/types.defaults.ts +24 -0
- package/src/types.ts +1240 -0
|
@@ -0,0 +1,693 @@
|
|
|
1
|
+
// Generated by .github/scripts/gen-platform-types.mts from .github/scripts/platform-headers/. Do not edit.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Insets from each edge, in points, as in `scrollView.contentInset`.
|
|
5
|
+
* @group Platform settings
|
|
6
|
+
* @ios
|
|
7
|
+
*/
|
|
8
|
+
export type UIEdgeInsets = { top: number; left: number; bottom: number; right: number };
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A point, as in `scrollView.contentOffset`.
|
|
12
|
+
* @group Platform settings
|
|
13
|
+
* @ios
|
|
14
|
+
*/
|
|
15
|
+
export type CGPoint = { x: number; y: number };
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* A size, as in `scrollView.contentSize`.
|
|
19
|
+
* @group Platform settings
|
|
20
|
+
* @ios
|
|
21
|
+
*/
|
|
22
|
+
export type CGSize = { width: number; height: number };
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A rectangle. No generated key takes one; it fits a setting under `other` and a `call` argument.
|
|
26
|
+
* @group Platform settings
|
|
27
|
+
* @ios
|
|
28
|
+
*/
|
|
29
|
+
export type CGRect = { x: number; y: number; width: number; height: number };
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The iOS settings keys by root: the writable WebKit and UIScrollView properties from the SDK headers whose type is a
|
|
33
|
+
* `SettingValue`.
|
|
34
|
+
* @group Platform settings
|
|
35
|
+
* @ios
|
|
36
|
+
*/
|
|
37
|
+
export type IOSSettingKeys = {
|
|
38
|
+
/** `WKWebViewConfiguration` */
|
|
39
|
+
configuration: {
|
|
40
|
+
/** @since iOS 9.0 */
|
|
41
|
+
websiteDataStore?: 'default' | 'nonPersistent';
|
|
42
|
+
suppressesIncrementalRendering?: boolean;
|
|
43
|
+
/** @since iOS 9.0 */
|
|
44
|
+
applicationNameForUserAgent?: string | null;
|
|
45
|
+
/** @since iOS 9.0 */
|
|
46
|
+
allowsAirPlayForMediaPlayback?: boolean;
|
|
47
|
+
/** @since iOS 26.0 */
|
|
48
|
+
showsSystemScreenTimeBlockingView?: boolean;
|
|
49
|
+
/** @since iOS 14.5 */
|
|
50
|
+
upgradeKnownHostsToHTTPS?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* A {@link IOSConstants.AudiovisualMediaTypes}.
|
|
53
|
+
* @since iOS 10.0
|
|
54
|
+
*/
|
|
55
|
+
mediaTypesRequiringUserActionForPlayback?: number;
|
|
56
|
+
/** @since iOS 14.0 */
|
|
57
|
+
limitsNavigationsToAppBoundDomains?: boolean;
|
|
58
|
+
/** @since iOS 17.0 */
|
|
59
|
+
allowsInlinePredictions?: boolean;
|
|
60
|
+
allowsInlineMediaPlayback?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* A {@link IOSConstants.SelectionGranularity}.
|
|
63
|
+
* @since iOS 8.0
|
|
64
|
+
* @deprecated This property is ignored; selection granularity is always `character`.
|
|
65
|
+
*/
|
|
66
|
+
selectionGranularity?: number;
|
|
67
|
+
/** @since iOS 9.0 */
|
|
68
|
+
allowsPictureInPictureMediaPlayback?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* A {@link IOSConstants.DataDetectorTypes}.
|
|
71
|
+
* @since iOS 10.0
|
|
72
|
+
*/
|
|
73
|
+
dataDetectorTypes?: number;
|
|
74
|
+
/** @since iOS 10.0 */
|
|
75
|
+
ignoresViewportScaleLimits?: boolean;
|
|
76
|
+
/** @since iOS 18.0 */
|
|
77
|
+
supportsAdaptiveImageGlyph?: boolean;
|
|
78
|
+
/** @since iOS 18.0 */
|
|
79
|
+
writingToolsBehavior?: number;
|
|
80
|
+
/**
|
|
81
|
+
* @since iOS 8.0
|
|
82
|
+
* @deprecated use mediaTypesRequiringUserActionForPlayback
|
|
83
|
+
*/
|
|
84
|
+
mediaPlaybackRequiresUserAction?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* @since iOS 8.0
|
|
87
|
+
* @deprecated use allowsAirPlayForMediaPlayback
|
|
88
|
+
*/
|
|
89
|
+
mediaPlaybackAllowsAirPlay?: boolean;
|
|
90
|
+
/**
|
|
91
|
+
* @since iOS 9.0
|
|
92
|
+
* @deprecated use mediaTypesRequiringUserActionForPlayback
|
|
93
|
+
*/
|
|
94
|
+
requiresUserActionForMediaPlayback?: boolean;
|
|
95
|
+
};
|
|
96
|
+
/** `WKPreferences` */
|
|
97
|
+
preferences: {
|
|
98
|
+
minimumFontSize?: number;
|
|
99
|
+
javaScriptCanOpenWindowsAutomatically?: boolean;
|
|
100
|
+
/** @since iOS 13.0 */
|
|
101
|
+
fraudulentWebsiteWarningEnabled?: boolean;
|
|
102
|
+
/** @since iOS 16.4 */
|
|
103
|
+
shouldPrintBackgrounds?: boolean;
|
|
104
|
+
/** @since iOS 14.5 */
|
|
105
|
+
textInteractionEnabled?: boolean;
|
|
106
|
+
/** @since iOS 15.4 */
|
|
107
|
+
siteSpecificQuirksModeEnabled?: boolean;
|
|
108
|
+
/** @since iOS 15.4 */
|
|
109
|
+
elementFullscreenEnabled?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* A {@link IOSConstants.InactiveSchedulingPolicy}.
|
|
112
|
+
* @since iOS 17.0
|
|
113
|
+
*/
|
|
114
|
+
inactiveSchedulingPolicy?: number;
|
|
115
|
+
/**
|
|
116
|
+
* @since iOS 8.0
|
|
117
|
+
* @deprecated Use WKWebpagePreferences.allowsContentJavaScript to disable content JavaScript on a per-navigation basis
|
|
118
|
+
*/
|
|
119
|
+
javaScriptEnabled?: boolean;
|
|
120
|
+
};
|
|
121
|
+
/** `WKWebpagePreferences` */
|
|
122
|
+
webpagePreferences: {
|
|
123
|
+
/**
|
|
124
|
+
* A {@link IOSConstants.ContentMode}.
|
|
125
|
+
* @since iOS 13.0
|
|
126
|
+
*/
|
|
127
|
+
preferredContentMode?: number;
|
|
128
|
+
/** @since iOS 14.0 */
|
|
129
|
+
allowsContentJavaScript?: boolean;
|
|
130
|
+
/** @since iOS 16.0 */
|
|
131
|
+
lockdownModeEnabled?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* A {@link IOSConstants.WebpagePreferencesUpgradeToHTTPSPolicy}.
|
|
134
|
+
* @since iOS 18.2
|
|
135
|
+
*/
|
|
136
|
+
preferredHTTPSNavigationPolicy?: number;
|
|
137
|
+
/**
|
|
138
|
+
* A {@link IOSConstants.SecurityRestrictionMode}.
|
|
139
|
+
* @since iOS 26.4
|
|
140
|
+
*/
|
|
141
|
+
securityRestrictionMode?: number;
|
|
142
|
+
/** @since iOS 27.0 */
|
|
143
|
+
overrideReferrer?: string | null;
|
|
144
|
+
/** @since iOS 27.0 */
|
|
145
|
+
allowsJSHandleCreationInPageWorld?: boolean;
|
|
146
|
+
/** @since iOS 27.0 */
|
|
147
|
+
globalPrivacyControlEnabled?: boolean;
|
|
148
|
+
};
|
|
149
|
+
/** `WKWebView` */
|
|
150
|
+
webView: {
|
|
151
|
+
allowsBackForwardNavigationGestures?: boolean;
|
|
152
|
+
/** @since iOS 9.0 */
|
|
153
|
+
customUserAgent?: string | null;
|
|
154
|
+
/** @since iOS 9.0 */
|
|
155
|
+
allowsLinkPreview?: boolean;
|
|
156
|
+
/** @since iOS 14.0 */
|
|
157
|
+
pageZoom?: number;
|
|
158
|
+
/** @since iOS 14.0 */
|
|
159
|
+
mediaType?: string | null;
|
|
160
|
+
/** @since iOS 15.0 */
|
|
161
|
+
underPageBackgroundColor?: string | null;
|
|
162
|
+
/** @since iOS 16.0 */
|
|
163
|
+
findInteractionEnabled?: boolean;
|
|
164
|
+
/** @since iOS 16.4 */
|
|
165
|
+
inspectable?: boolean;
|
|
166
|
+
/** @since iOS 26.0 */
|
|
167
|
+
obscuredContentInsets?: UIEdgeInsets;
|
|
168
|
+
};
|
|
169
|
+
/** `UIScrollView` */
|
|
170
|
+
scrollView: {
|
|
171
|
+
contentOffset?: CGPoint;
|
|
172
|
+
contentSize?: CGSize;
|
|
173
|
+
contentInset?: UIEdgeInsets;
|
|
174
|
+
/** @since iOS 17.4 */
|
|
175
|
+
contentAlignmentPoint?: CGPoint;
|
|
176
|
+
/**
|
|
177
|
+
* A {@link IOSConstants.ContentInsetAdjustmentBehavior}.
|
|
178
|
+
* @since iOS 11.0
|
|
179
|
+
*/
|
|
180
|
+
contentInsetAdjustmentBehavior?: number;
|
|
181
|
+
/** @since iOS 13.0 */
|
|
182
|
+
automaticallyAdjustsScrollIndicatorInsets?: boolean;
|
|
183
|
+
directionalLockEnabled?: boolean;
|
|
184
|
+
bounces?: boolean;
|
|
185
|
+
/** @since iOS 17.4 */
|
|
186
|
+
bouncesHorizontally?: boolean;
|
|
187
|
+
/** @since iOS 17.4 */
|
|
188
|
+
bouncesVertically?: boolean;
|
|
189
|
+
alwaysBounceVertical?: boolean;
|
|
190
|
+
alwaysBounceHorizontal?: boolean;
|
|
191
|
+
pagingEnabled?: boolean;
|
|
192
|
+
scrollEnabled?: boolean;
|
|
193
|
+
/** @since iOS 17.4 */
|
|
194
|
+
transfersHorizontalScrollingToParent?: boolean;
|
|
195
|
+
/** @since iOS 17.4 */
|
|
196
|
+
transfersVerticalScrollingToParent?: boolean;
|
|
197
|
+
showsVerticalScrollIndicator?: boolean;
|
|
198
|
+
showsHorizontalScrollIndicator?: boolean;
|
|
199
|
+
/** A {@link IOSConstants.IndicatorStyle}. */
|
|
200
|
+
indicatorStyle?: number;
|
|
201
|
+
/** @since iOS 11.1 */
|
|
202
|
+
verticalScrollIndicatorInsets?: UIEdgeInsets;
|
|
203
|
+
/** @since iOS 11.1 */
|
|
204
|
+
horizontalScrollIndicatorInsets?: UIEdgeInsets;
|
|
205
|
+
scrollIndicatorInsets?: UIEdgeInsets;
|
|
206
|
+
/** @since iOS 3.0 */
|
|
207
|
+
decelerationRate?: number;
|
|
208
|
+
delaysContentTouches?: boolean;
|
|
209
|
+
canCancelContentTouches?: boolean;
|
|
210
|
+
minimumZoomScale?: number;
|
|
211
|
+
maximumZoomScale?: number;
|
|
212
|
+
/** @since iOS 3.0 */
|
|
213
|
+
zoomScale?: number;
|
|
214
|
+
bouncesZoom?: boolean;
|
|
215
|
+
scrollsToTop?: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* A {@link IOSConstants.KeyboardDismissMode}.
|
|
218
|
+
* @since iOS 7.0
|
|
219
|
+
*/
|
|
220
|
+
keyboardDismissMode?: number;
|
|
221
|
+
/** @since iOS 17.0 */
|
|
222
|
+
allowsKeyboardScrolling?: boolean;
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* The Android settings keys by root: the one-argument setters of `WebSettings` and `WebView`, `CookieManager`'s
|
|
228
|
+
* `(WebView, value)` setter, the `WebSettingsCompat` and `WebViewCompat` statics, and the scroll setters `WebView`
|
|
229
|
+
* inherits from `View`.
|
|
230
|
+
* @group Platform settings
|
|
231
|
+
* @android
|
|
232
|
+
*/
|
|
233
|
+
export type AndroidSettingKeys = {
|
|
234
|
+
/** `WebSettings`, then `WebSettingsCompat` */
|
|
235
|
+
settings: {
|
|
236
|
+
/** @since Android API 33 */
|
|
237
|
+
algorithmicDarkeningAllowed?: boolean;
|
|
238
|
+
/** @since Android API 11 */
|
|
239
|
+
allowContentAccess?: boolean;
|
|
240
|
+
/** @since Android API 3 */
|
|
241
|
+
allowFileAccess?: boolean;
|
|
242
|
+
/**
|
|
243
|
+
* @since Android API 16
|
|
244
|
+
* @deprecated since API 30
|
|
245
|
+
*/
|
|
246
|
+
allowFileAccessFromFileURLs?: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* @since Android API 16
|
|
249
|
+
* @deprecated since API 30
|
|
250
|
+
*/
|
|
251
|
+
allowUniversalAccessFromFileURLs?: boolean;
|
|
252
|
+
/** @since Android API 1 */
|
|
253
|
+
blockNetworkImage?: boolean;
|
|
254
|
+
/** @since Android API 8 */
|
|
255
|
+
blockNetworkLoads?: boolean;
|
|
256
|
+
/** @since Android API 3 */
|
|
257
|
+
builtInZoomControls?: boolean;
|
|
258
|
+
/** @since Android API 1 */
|
|
259
|
+
cacheMode?: number;
|
|
260
|
+
/** @since Android API 1 */
|
|
261
|
+
cursiveFontFamily?: string | null;
|
|
262
|
+
/**
|
|
263
|
+
* @since Android API 5
|
|
264
|
+
* @deprecated since API 35
|
|
265
|
+
*/
|
|
266
|
+
databaseEnabled?: boolean;
|
|
267
|
+
/**
|
|
268
|
+
* @since Android API 5
|
|
269
|
+
* @deprecated since API 19
|
|
270
|
+
*/
|
|
271
|
+
databasePath?: string | null;
|
|
272
|
+
/** @since Android API 1 */
|
|
273
|
+
defaultFixedFontSize?: number;
|
|
274
|
+
/** @since Android API 1 */
|
|
275
|
+
defaultFontSize?: number;
|
|
276
|
+
/** @since Android API 1 */
|
|
277
|
+
defaultTextEncodingName?: string | null;
|
|
278
|
+
/** @since Android API 24 */
|
|
279
|
+
disabledActionModeMenuItems?: number;
|
|
280
|
+
/** @since Android API 11 */
|
|
281
|
+
displayZoomControls?: boolean;
|
|
282
|
+
/** @since Android API 7 */
|
|
283
|
+
domStorageEnabled?: boolean;
|
|
284
|
+
/**
|
|
285
|
+
* @since Android API 11
|
|
286
|
+
* @deprecated since API 17
|
|
287
|
+
*/
|
|
288
|
+
enableSmoothTransition?: boolean;
|
|
289
|
+
/** @since Android API 1 */
|
|
290
|
+
fantasyFontFamily?: string | null;
|
|
291
|
+
/** @since Android API 1 */
|
|
292
|
+
fixedFontFamily?: string | null;
|
|
293
|
+
/**
|
|
294
|
+
* @since Android API 29
|
|
295
|
+
* @deprecated since API 33
|
|
296
|
+
*/
|
|
297
|
+
forceDark?: number;
|
|
298
|
+
/**
|
|
299
|
+
* @since Android API 5
|
|
300
|
+
* @deprecated since API 24
|
|
301
|
+
*/
|
|
302
|
+
geolocationDatabasePath?: string | null;
|
|
303
|
+
/** @since Android API 5 */
|
|
304
|
+
geolocationEnabled?: boolean;
|
|
305
|
+
/** @since Android API 1 */
|
|
306
|
+
javaScriptCanOpenWindowsAutomatically?: boolean;
|
|
307
|
+
/** @since Android API 1 */
|
|
308
|
+
javaScriptEnabled?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* @since Android API 1
|
|
311
|
+
* @deprecated since API 18
|
|
312
|
+
*/
|
|
313
|
+
lightTouchEnabled?: boolean;
|
|
314
|
+
/** @since Android API 7 */
|
|
315
|
+
loadWithOverviewMode?: boolean;
|
|
316
|
+
/** @since Android API 1 */
|
|
317
|
+
loadsImagesAutomatically?: boolean;
|
|
318
|
+
/** @since Android API 17 */
|
|
319
|
+
mediaPlaybackRequiresUserGesture?: boolean;
|
|
320
|
+
/** @since Android API 1 */
|
|
321
|
+
minimumFontSize?: number;
|
|
322
|
+
/** @since Android API 1 */
|
|
323
|
+
minimumLogicalFontSize?: number;
|
|
324
|
+
/** @since Android API 21 */
|
|
325
|
+
mixedContentMode?: number;
|
|
326
|
+
/** @since Android API 1 */
|
|
327
|
+
needInitialFocus?: boolean;
|
|
328
|
+
/** @since Android API 23 */
|
|
329
|
+
offscreenPreRaster?: boolean;
|
|
330
|
+
/** @since Android API 26 */
|
|
331
|
+
safeBrowsingEnabled?: boolean;
|
|
332
|
+
/** @since Android API 1 */
|
|
333
|
+
sansSerifFontFamily?: string | null;
|
|
334
|
+
/**
|
|
335
|
+
* @since Android API 1
|
|
336
|
+
* @deprecated since API 26
|
|
337
|
+
*/
|
|
338
|
+
saveFormData?: boolean;
|
|
339
|
+
/**
|
|
340
|
+
* @since Android API 1
|
|
341
|
+
* @deprecated since API 18
|
|
342
|
+
*/
|
|
343
|
+
savePassword?: boolean;
|
|
344
|
+
/** @since Android API 1 */
|
|
345
|
+
serifFontFamily?: string | null;
|
|
346
|
+
/** @since Android API 1 */
|
|
347
|
+
standardFontFamily?: string | null;
|
|
348
|
+
/** @since Android API 1 */
|
|
349
|
+
supportMultipleWindows?: boolean;
|
|
350
|
+
/** @since Android API 1 */
|
|
351
|
+
supportZoom?: boolean;
|
|
352
|
+
/** @since Android API 14 */
|
|
353
|
+
textZoom?: number;
|
|
354
|
+
/** @since Android API 1 */
|
|
355
|
+
useWideViewPort?: boolean;
|
|
356
|
+
/** @since Android API 3 */
|
|
357
|
+
userAgentString?: string | null;
|
|
358
|
+
/** `WebSettingsCompat`, WebView feature `ATTRIBUTION_REGISTRATION_BEHAVIOR` */
|
|
359
|
+
attributionRegistrationBehavior?: number;
|
|
360
|
+
/** `WebSettingsCompat`, WebView feature `BACK_FORWARD_CACHE` */
|
|
361
|
+
backForwardCacheEnabled?: boolean;
|
|
362
|
+
/** `WebSettingsCompat`, WebView feature `COOKIE_INTERCEPT` */
|
|
363
|
+
cookiesIncludedInShouldInterceptRequest?: boolean;
|
|
364
|
+
/** `WebSettingsCompat`, WebView feature `DOWNLOAD_FAVICONS_ENABLED` */
|
|
365
|
+
downloadFaviconsEnabled?: boolean;
|
|
366
|
+
/** `WebSettingsCompat`, WebView feature `ENTERPRISE_AUTHENTICATION_APP_LINK_POLICY` */
|
|
367
|
+
enterpriseAuthenticationAppLinkPolicyEnabled?: boolean;
|
|
368
|
+
/**
|
|
369
|
+
* `WebSettingsCompat`, WebView feature `FORCE_DARK_STRATEGY`
|
|
370
|
+
* @deprecated in androidx.webkit
|
|
371
|
+
*/
|
|
372
|
+
forceDarkStrategy?: number;
|
|
373
|
+
/** `WebSettingsCompat`, WebView feature `PAYMENT_REQUEST` */
|
|
374
|
+
hasEnrolledInstrumentEnabled?: boolean;
|
|
375
|
+
/** `WebSettingsCompat`, WebView feature `HYPERLINK_CONTEXT_MENU_ITEMS` */
|
|
376
|
+
hyperlinkContextMenuItems?: number;
|
|
377
|
+
/** `WebSettingsCompat`, WebView feature `PAYMENT_REQUEST` */
|
|
378
|
+
paymentRequestEnabled?: boolean;
|
|
379
|
+
/** `WebSettingsCompat`, WebView feature `SPECULATIVE_LOADING` */
|
|
380
|
+
speculativeLoadingStatus?: number;
|
|
381
|
+
/** `WebSettingsCompat`, WebView feature `WEB_AUTHENTICATION` */
|
|
382
|
+
webAuthenticationSupport?: number;
|
|
383
|
+
};
|
|
384
|
+
/** `WebView`, then `WebViewCompat`, then `CookieManager`, then `View`'s scroll setters */
|
|
385
|
+
webView: {
|
|
386
|
+
/** @since Android API 28 */
|
|
387
|
+
dataDirectorySuffix?: string | null;
|
|
388
|
+
/**
|
|
389
|
+
* @since Android API 1
|
|
390
|
+
* @deprecated since API 23
|
|
391
|
+
*/
|
|
392
|
+
horizontalScrollbarOverlay?: boolean;
|
|
393
|
+
/** @since Android API 1 */
|
|
394
|
+
initialScale?: number;
|
|
395
|
+
/**
|
|
396
|
+
* @since Android API 1
|
|
397
|
+
* @deprecated since API 17
|
|
398
|
+
*/
|
|
399
|
+
mapTrackballToArrowKeys?: boolean;
|
|
400
|
+
/** @since Android API 3 */
|
|
401
|
+
networkAvailable?: boolean;
|
|
402
|
+
/**
|
|
403
|
+
* @since Android API 1
|
|
404
|
+
* @deprecated since API 23
|
|
405
|
+
*/
|
|
406
|
+
verticalScrollbarOverlay?: boolean;
|
|
407
|
+
/** `WebViewCompat`, WebView feature `MUTE_AUDIO` */
|
|
408
|
+
audioMuted?: boolean;
|
|
409
|
+
/** `WebViewCompat`, WebView feature `MULTI_PROFILE` */
|
|
410
|
+
profile?: string | null;
|
|
411
|
+
/**
|
|
412
|
+
* `CookieManager`
|
|
413
|
+
* @since Android API 21
|
|
414
|
+
*/
|
|
415
|
+
acceptThirdPartyCookies?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* `View`
|
|
418
|
+
* @since Android API 1
|
|
419
|
+
*/
|
|
420
|
+
horizontalScrollBarEnabled?: boolean;
|
|
421
|
+
/**
|
|
422
|
+
* `View`
|
|
423
|
+
* @since Android API 21
|
|
424
|
+
*/
|
|
425
|
+
nestedScrollingEnabled?: boolean;
|
|
426
|
+
/**
|
|
427
|
+
* `View`
|
|
428
|
+
* @since Android API 9
|
|
429
|
+
*/
|
|
430
|
+
overScrollMode?: number;
|
|
431
|
+
/**
|
|
432
|
+
* `View`
|
|
433
|
+
* @since Android API 16
|
|
434
|
+
*/
|
|
435
|
+
scrollBarDefaultDelayBeforeFade?: number;
|
|
436
|
+
/**
|
|
437
|
+
* `View`
|
|
438
|
+
* @since Android API 16
|
|
439
|
+
*/
|
|
440
|
+
scrollBarFadeDuration?: number;
|
|
441
|
+
/**
|
|
442
|
+
* `View`
|
|
443
|
+
* @since Android API 16
|
|
444
|
+
*/
|
|
445
|
+
scrollBarSize?: number;
|
|
446
|
+
/**
|
|
447
|
+
* `View`
|
|
448
|
+
* @since Android API 1
|
|
449
|
+
*/
|
|
450
|
+
scrollBarStyle?: number;
|
|
451
|
+
/**
|
|
452
|
+
* `View`
|
|
453
|
+
* @since Android API 31
|
|
454
|
+
*/
|
|
455
|
+
scrollCaptureHint?: number;
|
|
456
|
+
/**
|
|
457
|
+
* `View`
|
|
458
|
+
* @since Android API 3
|
|
459
|
+
*/
|
|
460
|
+
scrollContainer?: boolean;
|
|
461
|
+
/**
|
|
462
|
+
* `View`
|
|
463
|
+
* @since Android API 23
|
|
464
|
+
*/
|
|
465
|
+
scrollIndicators?: number;
|
|
466
|
+
/**
|
|
467
|
+
* `View`
|
|
468
|
+
* @since Android API 14
|
|
469
|
+
*/
|
|
470
|
+
scrollX?: number;
|
|
471
|
+
/**
|
|
472
|
+
* `View`
|
|
473
|
+
* @since Android API 14
|
|
474
|
+
*/
|
|
475
|
+
scrollY?: number;
|
|
476
|
+
/**
|
|
477
|
+
* `View`
|
|
478
|
+
* @since Android API 5
|
|
479
|
+
*/
|
|
480
|
+
scrollbarFadingEnabled?: boolean;
|
|
481
|
+
/**
|
|
482
|
+
* `View`
|
|
483
|
+
* @since Android API 1
|
|
484
|
+
*/
|
|
485
|
+
verticalScrollBarEnabled?: boolean;
|
|
486
|
+
/**
|
|
487
|
+
* `View`
|
|
488
|
+
* @since Android API 11
|
|
489
|
+
*/
|
|
490
|
+
verticalScrollbarPosition?: number;
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
/**
|
|
495
|
+
* WebKit's and UIScrollView's enums and option sets by raw value, for the iOS keys that take one:
|
|
496
|
+
* `configuration: { dataDetectorTypes: IOSConstants.DataDetectorTypes.link }`.
|
|
497
|
+
*
|
|
498
|
+
* An option set's `all` is the OR of its listed bits, not `NSUIntegerMax`, which JSON can't carry.
|
|
499
|
+
* These three are for `call`, not for keys:
|
|
500
|
+
*
|
|
501
|
+
* - `WebsiteDataType`: the data type names the `websiteDataStore` methods take.
|
|
502
|
+
* - `WebViewDataType`: the option set `webView.fetchDataOfTypes:` takes.
|
|
503
|
+
* - `CookiePolicy`: the value `httpCookieStore.setCookiePolicy:completionHandler:` takes.
|
|
504
|
+
* @group Platform settings
|
|
505
|
+
* @ios
|
|
506
|
+
* @namespace
|
|
507
|
+
* @hideGroups
|
|
508
|
+
*/
|
|
509
|
+
export const IOSConstants = {
|
|
510
|
+
/** @enum */
|
|
511
|
+
IndicatorStyle: {
|
|
512
|
+
default: 0,
|
|
513
|
+
black: 1,
|
|
514
|
+
white: 2,
|
|
515
|
+
},
|
|
516
|
+
/** @enum */
|
|
517
|
+
KeyboardDismissMode: {
|
|
518
|
+
none: 0,
|
|
519
|
+
onDrag: 1,
|
|
520
|
+
interactive: 2,
|
|
521
|
+
onDragWithAccessory: 3,
|
|
522
|
+
interactiveWithAccessory: 4,
|
|
523
|
+
},
|
|
524
|
+
/** @enum */
|
|
525
|
+
ContentInsetAdjustmentBehavior: {
|
|
526
|
+
automatic: 0,
|
|
527
|
+
scrollableAxes: 1,
|
|
528
|
+
never: 2,
|
|
529
|
+
always: 3,
|
|
530
|
+
},
|
|
531
|
+
/** @enum */
|
|
532
|
+
DataDetectorTypes: {
|
|
533
|
+
none: 0,
|
|
534
|
+
phoneNumber: 1,
|
|
535
|
+
link: 2,
|
|
536
|
+
address: 4,
|
|
537
|
+
calendarEvent: 8,
|
|
538
|
+
trackingNumber: 16,
|
|
539
|
+
flightNumber: 32,
|
|
540
|
+
lookupSuggestion: 64,
|
|
541
|
+
all: 127,
|
|
542
|
+
},
|
|
543
|
+
/** @enum */
|
|
544
|
+
CookiePolicy: {
|
|
545
|
+
allow: 0,
|
|
546
|
+
disallow: 1,
|
|
547
|
+
},
|
|
548
|
+
/** @enum */
|
|
549
|
+
InactiveSchedulingPolicy: {
|
|
550
|
+
suspend: 0,
|
|
551
|
+
throttle: 1,
|
|
552
|
+
none: 2,
|
|
553
|
+
},
|
|
554
|
+
/** @enum */
|
|
555
|
+
MediaPlaybackState: {
|
|
556
|
+
none: 0,
|
|
557
|
+
playing: 1,
|
|
558
|
+
paused: 2,
|
|
559
|
+
suspended: 3,
|
|
560
|
+
},
|
|
561
|
+
/** @enum */
|
|
562
|
+
MediaCaptureState: {
|
|
563
|
+
none: 0,
|
|
564
|
+
active: 1,
|
|
565
|
+
muted: 2,
|
|
566
|
+
},
|
|
567
|
+
/** @enum */
|
|
568
|
+
FullscreenState: {
|
|
569
|
+
notInFullscreen: 0,
|
|
570
|
+
enteringFullscreen: 1,
|
|
571
|
+
inFullscreen: 2,
|
|
572
|
+
exitingFullscreen: 3,
|
|
573
|
+
},
|
|
574
|
+
/** @enum */
|
|
575
|
+
WebViewDataType: {
|
|
576
|
+
sessionStorage: 1,
|
|
577
|
+
},
|
|
578
|
+
/** @enum */
|
|
579
|
+
SelectionGranularity: {
|
|
580
|
+
dynamic: 0,
|
|
581
|
+
character: 1,
|
|
582
|
+
},
|
|
583
|
+
/** @enum */
|
|
584
|
+
AudiovisualMediaTypes: {
|
|
585
|
+
none: 0,
|
|
586
|
+
audio: 1,
|
|
587
|
+
video: 2,
|
|
588
|
+
all: 3,
|
|
589
|
+
},
|
|
590
|
+
/** @enum */
|
|
591
|
+
ContentMode: {
|
|
592
|
+
recommended: 0,
|
|
593
|
+
mobile: 1,
|
|
594
|
+
desktop: 2,
|
|
595
|
+
},
|
|
596
|
+
/** @enum */
|
|
597
|
+
WebpagePreferencesUpgradeToHTTPSPolicy: {
|
|
598
|
+
keepAsRequested: 0,
|
|
599
|
+
automaticFallbackToHTTP: 1,
|
|
600
|
+
userMediatedFallbackToHTTP: 2,
|
|
601
|
+
errorOnFailure: 3,
|
|
602
|
+
},
|
|
603
|
+
/** @enum */
|
|
604
|
+
SecurityRestrictionMode: {
|
|
605
|
+
none: 0,
|
|
606
|
+
maximizeCompatibility: 1,
|
|
607
|
+
lockdown: 2,
|
|
608
|
+
},
|
|
609
|
+
/** @enum */
|
|
610
|
+
WebsiteDataType: {
|
|
611
|
+
fetchCache: 'WKWebsiteDataTypeFetchCache',
|
|
612
|
+
diskCache: 'WKWebsiteDataTypeDiskCache',
|
|
613
|
+
memoryCache: 'WKWebsiteDataTypeMemoryCache',
|
|
614
|
+
cookies: 'WKWebsiteDataTypeCookies',
|
|
615
|
+
sessionStorage: 'WKWebsiteDataTypeSessionStorage',
|
|
616
|
+
localStorage: 'WKWebsiteDataTypeLocalStorage',
|
|
617
|
+
webSQLDatabases: 'WKWebsiteDataTypeWebSQLDatabases',
|
|
618
|
+
indexedDBDatabases: 'WKWebsiteDataTypeIndexedDBDatabases',
|
|
619
|
+
serviceWorkerRegistrations: 'WKWebsiteDataTypeServiceWorkerRegistrations',
|
|
620
|
+
fileSystem: 'WKWebsiteDataTypeFileSystem',
|
|
621
|
+
searchFieldRecentSearches: 'WKWebsiteDataTypeSearchFieldRecentSearches',
|
|
622
|
+
mediaKeys: 'WKWebsiteDataTypeMediaKeys',
|
|
623
|
+
hashSalt: 'WKWebsiteDataTypeHashSalt',
|
|
624
|
+
screenTime: 'WKWebsiteDataTypeScreenTime',
|
|
625
|
+
},
|
|
626
|
+
} as const;
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* The `WebSettings`, `WebView`, `WebSettingsCompat` and `WebViewCompat` constants:
|
|
630
|
+
* `settings: { cacheMode: AndroidConstants.WebSettings.LOAD_NO_CACHE }`.
|
|
631
|
+
* @group Platform settings
|
|
632
|
+
* @android
|
|
633
|
+
* @namespace
|
|
634
|
+
* @hideGroups
|
|
635
|
+
*/
|
|
636
|
+
export const AndroidConstants = {
|
|
637
|
+
/** @enum */
|
|
638
|
+
WebSettings: {
|
|
639
|
+
FORCE_DARK_AUTO: 1,
|
|
640
|
+
FORCE_DARK_OFF: 0,
|
|
641
|
+
FORCE_DARK_ON: 2,
|
|
642
|
+
LOAD_CACHE_ELSE_NETWORK: 1,
|
|
643
|
+
LOAD_CACHE_ONLY: 3,
|
|
644
|
+
LOAD_DEFAULT: -1,
|
|
645
|
+
LOAD_NORMAL: 0,
|
|
646
|
+
LOAD_NO_CACHE: 2,
|
|
647
|
+
MENU_ITEM_NONE: 0,
|
|
648
|
+
MENU_ITEM_PROCESS_TEXT: 4,
|
|
649
|
+
MENU_ITEM_SHARE: 1,
|
|
650
|
+
MENU_ITEM_WEB_SEARCH: 2,
|
|
651
|
+
MIXED_CONTENT_ALWAYS_ALLOW: 0,
|
|
652
|
+
MIXED_CONTENT_COMPATIBILITY_MODE: 2,
|
|
653
|
+
MIXED_CONTENT_NEVER_ALLOW: 1,
|
|
654
|
+
},
|
|
655
|
+
/** @enum */
|
|
656
|
+
WebView: {
|
|
657
|
+
RENDERER_PRIORITY_BOUND: 1,
|
|
658
|
+
RENDERER_PRIORITY_IMPORTANT: 2,
|
|
659
|
+
RENDERER_PRIORITY_WAIVED: 0,
|
|
660
|
+
SCHEME_GEO: 'geo:0,0?q=',
|
|
661
|
+
SCHEME_MAILTO: 'mailto:',
|
|
662
|
+
SCHEME_TEL: 'tel:',
|
|
663
|
+
},
|
|
664
|
+
/** @enum */
|
|
665
|
+
WebSettingsCompat: {
|
|
666
|
+
ATTRIBUTION_BEHAVIOR_APP_SOURCE_AND_APP_TRIGGER: 3,
|
|
667
|
+
ATTRIBUTION_BEHAVIOR_APP_SOURCE_AND_WEB_TRIGGER: 1,
|
|
668
|
+
ATTRIBUTION_BEHAVIOR_DISABLED: 0,
|
|
669
|
+
ATTRIBUTION_BEHAVIOR_WEB_SOURCE_AND_WEB_TRIGGER: 2,
|
|
670
|
+
/** @deprecated */
|
|
671
|
+
DARK_STRATEGY_PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING: 2,
|
|
672
|
+
/** @deprecated */
|
|
673
|
+
DARK_STRATEGY_USER_AGENT_DARKENING_ONLY: 0,
|
|
674
|
+
/** @deprecated */
|
|
675
|
+
DARK_STRATEGY_WEB_THEME_DARKENING_ONLY: 1,
|
|
676
|
+
/** @deprecated */
|
|
677
|
+
FORCE_DARK_AUTO: 1,
|
|
678
|
+
/** @deprecated */
|
|
679
|
+
FORCE_DARK_OFF: 0,
|
|
680
|
+
/** @deprecated */
|
|
681
|
+
FORCE_DARK_ON: 2,
|
|
682
|
+
SPECULATIVE_LOADING_DISABLED: 0,
|
|
683
|
+
SPECULATIVE_LOADING_PRERENDER_ENABLED: 1,
|
|
684
|
+
WEB_AUTHENTICATION_SUPPORT_FOR_APP: 1,
|
|
685
|
+
WEB_AUTHENTICATION_SUPPORT_FOR_BROWSER: 2,
|
|
686
|
+
WEB_AUTHENTICATION_SUPPORT_NONE: 0,
|
|
687
|
+
},
|
|
688
|
+
/** @enum */
|
|
689
|
+
WebViewCompat: {
|
|
690
|
+
INJECTION_EVENT_DOCUMENT_END: 1,
|
|
691
|
+
INJECTION_EVENT_DOCUMENT_START: 0,
|
|
692
|
+
},
|
|
693
|
+
} as const;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { AndroidSettings, IOSSettings } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* react-native-webview's defaults, so that an app migrated from it behaves as before. An app sets any back through
|
|
5
|
+
* `ios` or `android`.
|
|
6
|
+
*/
|
|
7
|
+
export const REACT_NATIVE_WEBVIEW_DEFAULTS = {
|
|
8
|
+
ios: { scrollView: { directionalLockEnabled: true } },
|
|
9
|
+
android: {
|
|
10
|
+
settings: { useWideViewPort: true, loadWithOverviewMode: true },
|
|
11
|
+
webView: { acceptThirdPartyCookies: true },
|
|
12
|
+
},
|
|
13
|
+
} satisfies { ios: IOSSettings; android: AndroidSettings };
|