@exodus/react-native-webview 13.16.0-exodus.3 → 13.16.0-exodus.4

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.
Files changed (38) hide show
  1. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebChromeClient.java +15 -18
  2. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewClient.java +0 -21
  3. package/android/src/main/java/com/reactnativecommunity/webview/RNCWebViewManagerImpl.kt +5 -50
  4. package/android/src/newarch/com/reactnativecommunity/webview/RNCWebViewManager.java +0 -58
  5. package/android/src/oldarch/com/reactnativecommunity/webview/RNCWebViewManager.java +0 -40
  6. package/apple/RNCWebView.mm +0 -8
  7. package/apple/RNCWebViewDecisionManager.m +17 -0
  8. package/apple/RNCWebViewImpl.h +0 -10
  9. package/apple/RNCWebViewImpl.m +24 -72
  10. package/apple/RNCWebViewManager.mm +0 -8
  11. package/lib/RNCWebViewNativeComponent.d.ts +0 -26
  12. package/lib/RNCWebViewNativeComponent.js +1 -1
  13. package/lib/WebView.android.js +1 -1
  14. package/lib/WebView.d.ts +2 -2
  15. package/lib/WebView.ios.js +1 -1
  16. package/lib/WebViewShared.d.ts +5 -5
  17. package/lib/WebViewShared.js +1 -1
  18. package/lib/WebViewTypes.d.ts +5 -358
  19. package/lib/WebViewTypes.js +1 -1
  20. package/package.json +4 -11
  21. package/react-native-webview.podspec +1 -1
  22. package/src/RNCWebViewNativeComponent.ts +0 -37
  23. package/src/WebView.android.tsx +293 -284
  24. package/src/WebView.ios.tsx +223 -256
  25. package/src/WebView.tsx +2 -8
  26. package/src/WebViewShared.tsx +2 -11
  27. package/src/WebViewTypes.ts +2 -396
  28. package/src/__tests__/WebViewShared-test.js +40 -62
  29. package/src/__tests__/__snapshots__/WebViewShared-test.js.snap +0 -1
  30. package/android/src/main/java/com/reactnativecommunity/webview/events/TopHttpErrorEvent.kt +0 -25
  31. package/lib/WebView.windows.d.ts +0 -17
  32. package/lib/WebView.windows.js +0 -1
  33. package/lib/WebViewNativeComponent.windows.d.ts +0 -3
  34. package/lib/WebViewNativeComponent.windows.js +0 -1
  35. package/src/WebView.macos.tsx +0 -252
  36. package/src/WebView.windows.tsx +0 -217
  37. package/src/WebViewNativeComponent.macos.ts +0 -7
  38. package/src/WebViewNativeComponent.windows.ts +0 -8
@@ -1,7 +1,7 @@
1
- import { ReactElement, Component, ComponentProps, ElementType } from 'react';
2
- import { NativeSyntheticEvent, ViewProps, StyleProp, ViewStyle, NativeMethodsMixin, UIManagerStatic, NativeScrollEvent } from 'react-native';
1
+ import { ReactElement, ComponentProps, ElementType } from 'react';
2
+ import { NativeSyntheticEvent, ViewProps, StyleProp, ViewStyle, UIManagerStatic, NativeScrollEvent } from 'react-native';
3
3
  import type NativeWebViewComponent from './RNCWebViewNativeComponent';
4
- type WebViewCommands = 'goForward' | 'goBack' | 'reload' | 'stopLoading' | 'postMessage' | 'injectJavaScript' | 'loadUrl' | 'requestFocus' | 'clearCache';
4
+ type WebViewCommands = 'goForward' | 'goBack' | 'reload' | 'stopLoading' | 'postMessage' | 'loadUrl' | 'requestFocus' | 'clearCache';
5
5
  type AndroidWebViewCommands = 'clearHistory' | 'clearFormData';
6
6
  interface RNCWebViewUIManager<Commands extends string> extends UIManagerStatic {
7
7
  getViewManagerConfig: (name: string) => {
@@ -12,8 +12,6 @@ interface RNCWebViewUIManager<Commands extends string> extends UIManagerStatic {
12
12
  }
13
13
  export type RNCWebViewUIManagerAndroid = RNCWebViewUIManager<WebViewCommands | AndroidWebViewCommands>;
14
14
  export type RNCWebViewUIManagerIOS = RNCWebViewUIManager<WebViewCommands>;
15
- export type RNCWebViewUIManagerMacOS = RNCWebViewUIManager<WebViewCommands>;
16
- export type RNCWebViewUIManagerWindows = RNCWebViewUIManager<WebViewCommands>;
17
15
  type WebViewState = 'IDLE' | 'LOADING' | 'ERROR';
18
16
  interface BaseState {
19
17
  viewState: WebViewState;
@@ -27,17 +25,6 @@ interface ErrorState extends BaseState {
27
25
  lastErrorEvent: WebViewError;
28
26
  }
29
27
  export type State = NormalState | ErrorState;
30
- type Constructor<T> = new (...args: any[]) => T;
31
- declare class NativeWebViewMacOSComponent extends Component<MacOSNativeWebViewProps> {
32
- }
33
- declare const NativeWebViewMacOSBase: Constructor<NativeMethodsMixin> & typeof NativeWebViewMacOSComponent;
34
- export declare class NativeWebViewMacOS extends NativeWebViewMacOSBase {
35
- }
36
- declare class NativeWebViewWindowsComponent extends Component<WindowsNativeWebViewProps> {
37
- }
38
- declare const NativeWebViewWindowsBase: Constructor<NativeMethodsMixin> & typeof NativeWebViewWindowsComponent;
39
- export declare class NativeWebViewWindows extends NativeWebViewWindowsBase {
40
- }
41
28
  export interface ContentInsetProp {
42
29
  top?: number;
43
30
  left?: number;
@@ -62,25 +49,18 @@ export interface WebViewNavigation extends WebViewNativeEvent {
62
49
  export interface ShouldStartLoadRequest extends WebViewNavigation {
63
50
  isTopFrame: boolean;
64
51
  }
65
- export interface FileDownload {
66
- downloadUrl: string;
67
- }
68
52
  export type DecelerationRateConstant = 'normal' | 'fast';
69
53
  export interface WebViewMessage extends WebViewNativeEvent {
70
54
  data: string;
71
55
  }
72
56
  export interface WebViewError extends WebViewNativeEvent {
73
57
  /**
74
- * `domain` is only used on iOS and macOS
58
+ * `domain` is only used on iOS
75
59
  */
76
60
  domain?: string;
77
61
  code: number;
78
62
  description: string;
79
63
  }
80
- export interface WebViewHttpError extends WebViewNativeEvent {
81
- description: string;
82
- statusCode: number;
83
- }
84
64
  export interface WebViewRenderProcessGoneDetail {
85
65
  didCrash: boolean;
86
66
  }
@@ -91,11 +71,9 @@ export type WebViewEvent = NativeSyntheticEvent<WebViewNativeEvent>;
91
71
  export type WebViewProgressEvent = NativeSyntheticEvent<WebViewNativeProgressEvent>;
92
72
  export type WebViewNavigationEvent = NativeSyntheticEvent<WebViewNavigation>;
93
73
  export type ShouldStartLoadRequestEvent = NativeSyntheticEvent<ShouldStartLoadRequest>;
94
- export type FileDownloadEvent = NativeSyntheticEvent<FileDownload>;
95
74
  export type WebViewMessageEvent = NativeSyntheticEvent<WebViewMessage>;
96
75
  export type WebViewErrorEvent = NativeSyntheticEvent<WebViewError>;
97
76
  export type WebViewTerminatedEvent = NativeSyntheticEvent<WebViewNativeEvent>;
98
- export type WebViewHttpErrorEvent = NativeSyntheticEvent<WebViewHttpError>;
99
77
  export type WebViewRenderProcessGoneEvent = NativeSyntheticEvent<WebViewRenderProcessGoneDetail>;
100
78
  export type WebViewOpenWindowEvent = NativeSyntheticEvent<WebViewOpenWindow>;
101
79
  export type WebViewScrollEvent = NativeSyntheticEvent<NativeScrollEvent>;
@@ -153,22 +131,6 @@ export type WebViewSource = WebViewSourceUri | WebViewSourceHtml;
153
131
  export interface ViewManager {
154
132
  shouldStartLoadWithLockIdentifier: Function;
155
133
  }
156
- export interface WebViewNativeConfig {
157
- /**
158
- * The native component used to render the WebView.
159
- */
160
- component?: typeof NativeWebViewMacOS | typeof NativeWebViewComponent;
161
- /**
162
- * Set props directly on the native component WebView. Enables custom props which the
163
- * original WebView doesn't pass through.
164
- */
165
- props?: Object;
166
- /**
167
- * Set the ViewManager to use for communication with the native side.
168
- * @platform ios, macos
169
- */
170
- viewManager?: ViewManager;
171
- }
172
134
  export type OnShouldStartLoadWithRequest = (event: ShouldStartLoadRequest) => boolean;
173
135
  export interface BasicAuthCredential {
174
136
  /**
@@ -185,9 +147,6 @@ export interface CommonNativeWebViewProps extends ViewProps {
185
147
  incognito?: boolean;
186
148
  injectedJavaScript?: string;
187
149
  injectedJavaScriptBeforeContentLoaded?: string;
188
- injectedJavaScriptForMainFrameOnly?: boolean;
189
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
190
- javaScriptCanOpenWindowsAutomatically?: boolean;
191
150
  mediaPlaybackRequiresUserAction?: boolean;
192
151
  webviewDebuggingEnabled?: boolean;
193
152
  messagingEnabled: boolean;
@@ -201,7 +160,6 @@ export interface CommonNativeWebViewProps extends ViewProps {
201
160
  onLoadingFinish: (event: WebViewNavigationEvent) => void;
202
161
  onLoadingProgress: (event: WebViewProgressEvent) => void;
203
162
  onLoadingStart: (event: WebViewNavigationEvent) => void;
204
- onHttpError: (event: WebViewHttpErrorEvent) => void;
205
163
  onMessage: (event: WebViewMessageEvent) => void;
206
164
  onShouldStartLoadWithRequest: (event: ShouldStartLoadRequestEvent) => void;
207
165
  showsHorizontalScrollIndicator?: boolean;
@@ -209,68 +167,11 @@ export interface CommonNativeWebViewProps extends ViewProps {
209
167
  paymentRequestEnabled?: boolean;
210
168
  source: any;
211
169
  userAgent?: string;
212
- /**
213
- * Append to the existing user-agent. Overridden if `userAgent` is set.
214
- */
215
- applicationNameForUserAgent?: string;
216
170
  basicAuthCredential?: BasicAuthCredential;
217
171
  }
218
172
  export declare type ContentInsetAdjustmentBehavior = 'automatic' | 'scrollableAxes' | 'never' | 'always';
219
173
  export declare type MediaCapturePermissionGrantType = 'grantIfSameHostElsePrompt' | 'grantIfSameHostElseDeny' | 'deny' | 'grant' | 'prompt';
220
174
  export declare type ContentMode = 'recommended' | 'mobile' | 'desktop';
221
- export interface MacOSNativeWebViewProps extends CommonNativeWebViewProps {
222
- allowingReadAccessToURL?: string;
223
- allowFileAccessFromFileURLs?: boolean;
224
- allowUniversalAccessFromFileURLs?: boolean;
225
- allowsBackForwardNavigationGestures?: boolean;
226
- allowsInlineMediaPlayback?: boolean;
227
- allowsPictureInPictureMediaPlayback?: boolean;
228
- allowsAirPlayForMediaPlayback?: boolean;
229
- allowsLinkPreview?: boolean;
230
- automaticallyAdjustContentInsets?: boolean;
231
- bounces?: boolean;
232
- contentInset?: ContentInsetProp;
233
- contentInsetAdjustmentBehavior?: ContentInsetAdjustmentBehavior;
234
- directionalLockEnabled?: boolean;
235
- hideKeyboardAccessoryView?: boolean;
236
- javaScriptEnabled?: boolean;
237
- pagingEnabled?: boolean;
238
- scrollEnabled?: boolean;
239
- useSharedProcessPool?: boolean;
240
- onContentProcessDidTerminate?: (event: WebViewTerminatedEvent) => void;
241
- }
242
- export interface WindowsNativeWebViewProps extends CommonNativeWebViewProps {
243
- testID?: string;
244
- linkHandlingEnabled?: boolean;
245
- onOpenWindow?: (event: WebViewOpenWindowEvent) => void;
246
- onSourceChanged?: (event: WebViewNavigationEvent) => void;
247
- }
248
- export interface WindowsWebViewProps extends WebViewSharedProps {
249
- /**
250
- * Boolean value that detenmines whether the web view should use the new chromium based edge webview.
251
- */
252
- useWebView2?: boolean;
253
- /**
254
- * Function that is invoked when the `WebView` should open a new window.
255
- *
256
- * This happens when the JS calls `window.open('http://someurl', '_blank')`
257
- * or when the user clicks on a `<a href="http://someurl" target="_blank">` link.
258
- *
259
- * Only works with `useWebView2` set to `true`.
260
- *
261
- * @platform windows
262
- */
263
- onOpenWindow?: (event: WebViewOpenWindowEvent) => void;
264
- /**
265
- * Function that is invoked when the `WebView` responds to a request to load a new resource.
266
- * Works only on Windows.
267
- *
268
- * Only works with `useWebView2` set to `true`.
269
- *
270
- * @platform windows
271
- */
272
- onSourceChanged?: (event: WebViewNavigationEvent) => void;
273
- }
274
175
  export interface IOSWebViewProps extends WebViewSharedProps {
275
176
  /**
276
177
  * Does not store any data within the lifetime of the WebView.
@@ -381,14 +282,9 @@ export interface IOSWebViewProps extends WebViewSharedProps {
381
282
  * Boolean value that indicates whether HTML5 videos can play Picture in Picture.
382
283
  * The default value is `true`.
383
284
  *
384
- * @platform macos
385
- */
386
- allowsPictureInPictureMediaPlayback?: boolean;
387
- /**
388
- * A Boolean value indicating whether AirPlay is allowed. The default value is `false`.
389
285
  * @platform ios
390
286
  */
391
- allowsAirPlayForMediaPlayback?: boolean;
287
+ allowsPictureInPictureMediaPlayback?: boolean;
392
288
  /**
393
289
  * Hide the accessory view when the keyboard is open. Default is false to be
394
290
  * backward compatible.
@@ -456,30 +352,6 @@ export interface IOSWebViewProps extends WebViewSharedProps {
456
352
  * @platform ios
457
353
  */
458
354
  keyboardDisplayRequiresUserAction?: boolean;
459
- /**
460
- * A String value that indicates which URLs the WebView's file can then
461
- * reference in scripts, AJAX requests, and CSS imports. This is only used
462
- * for WebViews that are loaded with a source.uri set to a `'file://'` URL.
463
- *
464
- * If not provided, the default is to only allow read access to the URL
465
- * provided in source.uri itself.
466
- * @platform ios
467
- */
468
- allowingReadAccessToURL?: string;
469
- /**
470
- * Boolean that sets whether JavaScript running in the context of a file
471
- * scheme URL should be allowed to access content from other file scheme URLs.
472
- * Including accessing content from other file scheme URLs
473
- * @platform ios
474
- */
475
- allowFileAccessFromFileURLs?: boolean;
476
- /**
477
- * Boolean that sets whether JavaScript running in the context of a file
478
- * scheme URL should be allowed to access content from any origin.
479
- * Including accessing content from other file scheme URLs
480
- * @platform ios
481
- */
482
- allowUniversalAccessFromFileURLs?: boolean;
483
355
  /**
484
356
  * Function that is invoked when the WebKit WebView content process gets terminated.
485
357
  * @platform ios
@@ -494,18 +366,6 @@ export interface IOSWebViewProps extends WebViewSharedProps {
494
366
  * @platform ios
495
367
  */
496
368
  onOpenWindow?: (event: WebViewOpenWindowEvent) => void;
497
- /**
498
- * If `true` (default), loads the `injectedJavaScript` only into the main frame.
499
- * If `false`, loads it into all frames (e.g. iframes).
500
- * @platform ios
501
- */
502
- injectedJavaScriptForMainFrameOnly?: boolean;
503
- /**
504
- * If `true` (default), loads the `injectedJavaScriptBeforeContentLoaded` only into the main frame.
505
- * If `false`, loads it into all frames (e.g. iframes).
506
- * @platform ios
507
- */
508
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
509
369
  /**
510
370
  * Boolean value that determines whether a pull to refresh gesture is
511
371
  * available in the `WebView`. The default value is `false`.
@@ -533,23 +393,6 @@ export interface IOSWebViewProps extends WebViewSharedProps {
533
393
  * @platform ios
534
394
  */
535
395
  indicatorStyle?: IndicatorStyleType;
536
- /**
537
- * Function that is invoked when the client needs to download a file.
538
- *
539
- * iOS 13+ only: If the webview navigates to a URL that results in an HTTP
540
- * response with a Content-Disposition header 'attachment...', then
541
- * this will be called.
542
- *
543
- * iOS 8+: If the MIME type indicates that the content is not renderable by the
544
- * webview, that will also cause this to be called. On iOS versions before 13,
545
- * this is the only condition that will cause this function to be called.
546
- *
547
- * The application will need to provide its own code to actually download
548
- * the file.
549
- *
550
- * If not provided, the default is to let the webview try to render the file.
551
- */
552
- onFileDownload?: (event: FileDownloadEvent) => void;
553
396
  /**
554
397
  * A Boolean value which, when set to `true`, indicates to WebKit that a WKWebView
555
398
  * will only navigate to app-bound domains. Once set, any attempt to navigate away
@@ -633,154 +476,6 @@ export interface IOSWebViewProps extends WebViewSharedProps {
633
476
  */
634
477
  unsupportedVersionComponent?: ElementType;
635
478
  }
636
- export interface MacOSWebViewProps extends WebViewSharedProps {
637
- /**
638
- * Does not store any data within the lifetime of the WebView.
639
- */
640
- incognito?: boolean;
641
- /**
642
- * Boolean value that determines whether the web view bounces
643
- * when it reaches the edge of the content. The default value is `true`.
644
- * @platform macos
645
- */
646
- bounces?: boolean;
647
- /**
648
- * Boolean value that determines whether scrolling is enabled in the
649
- * `WebView`. The default value is `true`.
650
- * @platform macos
651
- */
652
- scrollEnabled?: boolean;
653
- /**
654
- * If the value of this property is true, the scroll view stops on multiples
655
- * of the scroll view's bounds when the user scrolls.
656
- * The default value is false.
657
- * @platform macos
658
- */
659
- pagingEnabled?: boolean;
660
- /**
661
- * Controls whether to adjust the content inset for web views that are
662
- * placed behind a navigation bar, tab bar, or toolbar. The default value
663
- * is `true`.
664
- * @platform macos
665
- */
666
- automaticallyAdjustContentInsets?: boolean;
667
- /**
668
- * This property specifies how the safe area insets are used to modify the
669
- * content area of the scroll view. The default value of this property is
670
- * "never". Available on iOS 11 and later.
671
- */
672
- contentInsetAdjustmentBehavior?: ContentInsetAdjustmentBehavior;
673
- /**
674
- * The amount by which the web view content is inset from the edges of
675
- * the scroll view. Defaults to {top: 0, left: 0, bottom: 0, right: 0}.
676
- * @platform macos
677
- */
678
- contentInset?: ContentInsetProp;
679
- /**
680
- * Boolean that determines whether HTML5 videos play inline or use the
681
- * native full-screen controller. The default value is `false`.
682
- *
683
- * **NOTE** : In order for video to play inline, not only does this
684
- * property need to be set to `true`, but the video element in the HTML
685
- * document must also include the `webkit-playsinline` attribute.
686
- * @platform macos
687
- */
688
- allowsInlineMediaPlayback?: boolean;
689
- /**
690
- * Boolean value that indicates whether HTML5 videos can play Picture in Picture.
691
- * The default value is `true`.
692
- *
693
- * @platform ios
694
- */
695
- allowsPictureInPictureMediaPlayback?: boolean;
696
- /**
697
- * A Boolean value indicating whether AirPlay is allowed. The default value is `false`.
698
- * @platform macos
699
- */
700
- allowsAirPlayForMediaPlayback?: boolean;
701
- /**
702
- * Hide the accessory view when the keyboard is open. Default is false to be
703
- * backward compatible.
704
- */
705
- hideKeyboardAccessoryView?: boolean;
706
- /**
707
- * A Boolean value indicating whether horizontal swipe gestures will trigger
708
- * back-forward list navigations.
709
- */
710
- allowsBackForwardNavigationGestures?: boolean;
711
- /**
712
- * A Boolean value indicating whether WebKit WebView should be created using a shared
713
- * process pool, enabling WebViews to share cookies and localStorage between each other.
714
- * Default is true but can be set to false for backwards compatibility.
715
- * @platform macos
716
- */
717
- useSharedProcessPool?: boolean;
718
- /**
719
- * The custom user agent string.
720
- */
721
- userAgent?: string;
722
- /**
723
- * A Boolean value that determines whether pressing on a link
724
- * displays a preview of the destination for the link.
725
- *
726
- * This property is available on devices that support Force Touch trackpad.
727
- * @platform macos
728
- */
729
- allowsLinkPreview?: boolean;
730
- /**
731
- * Set true if shared cookies from HTTPCookieStorage should used for every load request.
732
- * The default value is `false`.
733
- * @platform macos
734
- */
735
- sharedCookiesEnabled?: boolean;
736
- /**
737
- * A Boolean value that determines whether scrolling is disabled in a particular direction.
738
- * The default value is `true`.
739
- * @platform macos
740
- */
741
- directionalLockEnabled?: boolean;
742
- /**
743
- * A Boolean value indicating whether web content can programmatically display the keyboard.
744
- *
745
- * When this property is set to true, the user must explicitly tap the elements in the
746
- * web view to display the keyboard (or other relevant input view) for that element.
747
- * When set to false, a focus event on an element causes the input view to be displayed
748
- * and associated with that element automatically.
749
- *
750
- * The default value is `true`.
751
- * @platform macos
752
- */
753
- keyboardDisplayRequiresUserAction?: boolean;
754
- /**
755
- * A String value that indicates which URLs the WebView's file can then
756
- * reference in scripts, AJAX requests, and CSS imports. This is only used
757
- * for WebViews that are loaded with a source.uri set to a `'file://'` URL.
758
- *
759
- * If not provided, the default is to only allow read access to the URL
760
- * provided in source.uri itself.
761
- * @platform macos
762
- */
763
- allowingReadAccessToURL?: string;
764
- /**
765
- * Boolean that sets whether JavaScript running in the context of a file
766
- * scheme URL should be allowed to access content from other file scheme URLs.
767
- * Including accessing content from other file scheme URLs
768
- * @platform macos
769
- */
770
- allowFileAccessFromFileURLs?: boolean;
771
- /**
772
- * Boolean that sets whether JavaScript running in the context of a file
773
- * scheme URL should be allowed to access content from any origin.
774
- * Including accessing content from other file scheme URLs
775
- * @platform macos
776
- */
777
- allowUniversalAccessFromFileURLs?: boolean;
778
- /**
779
- * Function that is invoked when the WebKit WebView content process gets terminated.
780
- * @platform macos
781
- */
782
- onContentProcessDidTerminate?: (event: WebViewTerminatedEvent) => void;
783
- }
784
479
  export interface AndroidWebViewProps extends WebViewSharedProps {
785
480
  onNavigationStateChange?: (event: WebViewNavigation) => void;
786
481
  onContentSizeChange?: (event: WebViewEvent) => void;
@@ -832,25 +527,6 @@ export interface AndroidWebViewProps extends WebViewSharedProps {
832
527
  * @platform android
833
528
  */
834
529
  geolocationEnabled?: boolean;
835
- /**
836
- * Boolean that sets whether JavaScript running in the context of a file
837
- * scheme URL should be allowed to access content from other file scheme URLs.
838
- * Including accessing content from other file scheme URLs
839
- * @platform android
840
- */
841
- allowFileAccessFromFileURLs?: boolean;
842
- /**
843
- * Boolean that sets whether JavaScript running in the context of a file
844
- * scheme URL should be allowed to access content from any origin.
845
- * Including accessing content from other file scheme URLs
846
- * @platform android
847
- */
848
- allowUniversalAccessFromFileURLs?: boolean;
849
- /**
850
- * Sets whether the webview allow access to file system.
851
- * @platform android
852
- */
853
- allowFileAccess?: boolean;
854
530
  /**
855
531
  * Used on Android only, controls whether form autocomplete data should be saved
856
532
  * @platform android
@@ -1002,11 +678,6 @@ export interface WebViewSharedProps extends ViewProps {
1002
678
  * @platform android
1003
679
  */
1004
680
  javaScriptEnabled?: boolean;
1005
- /**
1006
- * A Boolean value indicating whether JavaScript can open windows without user interaction.
1007
- * The default value is `false`.
1008
- */
1009
- javaScriptCanOpenWindowsAutomatically?: boolean;
1010
681
  /**
1011
682
  * Stylesheet object to set the style of the container view.
1012
683
  */
@@ -1039,11 +710,6 @@ export interface WebViewSharedProps extends ViewProps {
1039
710
  * Function that is invoked when the `WebView` load fails.
1040
711
  */
1041
712
  onError?: (event: WebViewErrorEvent) => void;
1042
- /**
1043
- * Function that is invoked when the `WebView` receives an error status code.
1044
- * Works on iOS and Android (minimum API level 23).
1045
- */
1046
- onHttpError?: (event: WebViewHttpErrorEvent) => void;
1047
713
  /**
1048
714
  * Function that is invoked when the `WebView` loading starts or ends.
1049
715
  */
@@ -1077,16 +743,6 @@ export interface WebViewSharedProps extends ViewProps {
1077
743
  * once the webview is initialized but before the view loads any content.
1078
744
  */
1079
745
  injectedJavaScriptBeforeContentLoaded?: string;
1080
- /**
1081
- * If `true` (default; mandatory for Android), loads the `injectedJavaScript` only into the main frame.
1082
- * If `false` (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
1083
- */
1084
- injectedJavaScriptForMainFrameOnly?: boolean;
1085
- /**
1086
- * If `true` (default; mandatory for Android), loads the `injectedJavaScriptBeforeContentLoaded` only into the main frame.
1087
- * If `false` (only supported on iOS and macOS), loads it into all frames (e.g. iframes).
1088
- */
1089
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: boolean;
1090
746
  /**
1091
747
  * Boolean value that determines whether a horizontal scroll indicator is
1092
748
  * shown in the `WebView`. The default value is `true`.
@@ -1123,19 +779,10 @@ export interface WebViewSharedProps extends ViewProps {
1123
779
  * to stop loading. The `navigationType` is always `other` on android.
1124
780
  */
1125
781
  onShouldStartLoadWithRequest?: OnShouldStartLoadWithRequest;
1126
- /**
1127
- * Override the native component used to render the WebView. Enables a custom native
1128
- * WebView which uses the same JavaScript as the original WebView.
1129
- */
1130
- nativeConfig?: WebViewNativeConfig;
1131
782
  /**
1132
783
  * Should caching be enabled. Default is true.
1133
784
  */
1134
785
  cacheEnabled?: boolean;
1135
- /**
1136
- * Append to the existing user-agent. Overridden if `userAgent` is set.
1137
- */
1138
- applicationNameForUserAgent?: string;
1139
786
  /**
1140
787
  * An object that specifies the credentials of a user to be used for basic authentication.
1141
788
  */
@@ -1 +1 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.NativeWebViewWindows=exports.NativeWebViewMacOS=void 0;var _createClass2=_interopRequireDefault(require("@babel/runtime/helpers/createClass"));var _classCallCheck2=_interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));var _possibleConstructorReturn2=_interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));var _getPrototypeOf2=_interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));var _inherits2=_interopRequireDefault(require("@babel/runtime/helpers/inherits"));var _react=require("react");function _callSuper(t,o,e){return o=(0,_getPrototypeOf2.default)(o),(0,_possibleConstructorReturn2.default)(t,_isNativeReflectConstruct()?Reflect.construct(o,e||[],(0,_getPrototypeOf2.default)(t).constructor):o.apply(t,e));}function _isNativeReflectConstruct(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}));}catch(t){}return(_isNativeReflectConstruct=function _isNativeReflectConstruct(){return!!t;})();}var NativeWebViewMacOS=exports.NativeWebViewMacOS=function(_NativeWebViewMacOSBa){(0,_inherits2.default)(NativeWebViewMacOS,_NativeWebViewMacOSBa);function NativeWebViewMacOS(){(0,_classCallCheck2.default)(this,NativeWebViewMacOS);return _callSuper(this,NativeWebViewMacOS,arguments);}return(0,_createClass2.default)(NativeWebViewMacOS);}(NativeWebViewMacOSBase);var NativeWebViewWindows=exports.NativeWebViewWindows=function(_NativeWebViewWindows){(0,_inherits2.default)(NativeWebViewWindows,_NativeWebViewWindows);function NativeWebViewWindows(){(0,_classCallCheck2.default)(this,NativeWebViewWindows);return _callSuper(this,NativeWebViewWindows,arguments);}return(0,_createClass2.default)(NativeWebViewWindows);}(NativeWebViewWindowsBase);
1
+ Object.defineProperty(exports,"__esModule",{value:true});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/react-native-webview",
3
- "description": "React Native WebView component for iOS, Android, macOS, and Windows",
3
+ "description": "React Native WebView component for iOS and Android",
4
4
  "main": "index.js",
5
5
  "main-internal": "src/index.ts",
6
6
  "react-native": "src/index.ts",
@@ -10,23 +10,19 @@
10
10
  "Thibault Malbranche <malbranche.thibault@gmail.com>"
11
11
  ],
12
12
  "license": "MIT",
13
- "version": "13.16.0-exodus.3",
13
+ "version": "13.16.0-exodus.4",
14
14
  "homepage": "https://github.com/ExodusMovement/react-native-webview#readme",
15
15
  "scripts": {
16
16
  "android": "react-native run-android",
17
17
  "ios": "react-native run-ios",
18
- "macos": "react-native run-macos --scheme WebviewExample --project-path example/macos",
19
18
  "start": "react-native start",
20
- "windows": "install-windows-test-app --project-directory example/windows && react-native run-windows --root example --arch x64",
21
19
  "ci": "CI=true && yarn lint",
22
20
  "ci:publish": "yarn semantic-release",
23
21
  "lint": "yarn tsc --noEmit && yarn eslint ./src --ext .ts,.tsx,.js,.jsx",
24
22
  "build": "babel --extensions \".ts,.tsx\" --out-dir lib src",
25
23
  "prepare:types": "tsc --noEmit false --emitDeclarationOnly --declaration --rootDir src --outDir lib",
26
24
  "prepare": "yarn prepare:types && yarn build",
27
- "appium": "appium",
28
- "test:windows": "yarn jest --setupFiles=./jest-setups/jest.setup.js",
29
- "add:macos": "yarn add react-native-macos@0.73.17"
25
+ "appium": "appium"
30
26
  },
31
27
  "rn-docs": {
32
28
  "title": "Webview",
@@ -61,14 +57,11 @@
61
57
  "prettier": "2.8.8",
62
58
  "react": "18.2.0",
63
59
  "react-native": "0.73.5",
64
- "react-native-macos": "0.73.17",
65
60
  "react-native-test-app": "3.7.2",
66
- "react-native-windows": "0.73.8",
67
61
  "selenium-appium": "1.0.2",
68
62
  "selenium-webdriver": "4.0.0-alpha.7",
69
63
  "semantic-release": "15.13.24",
70
- "typescript": "5.1.3",
71
- "winappdriver": "^0.0.7"
64
+ "typescript": "5.1.3"
72
65
  },
73
66
  "repository": {
74
67
  "type": "git",
@@ -13,7 +13,7 @@ Pod::Spec.new do |s|
13
13
 
14
14
  s.authors = package['author']
15
15
  s.homepage = package['homepage']
16
- s.platforms = { :ios => ios_platform, :osx => "10.13", :visionos => "1.0" }
16
+ s.platforms = { :ios => ios_platform, :visionos => "1.0" }
17
17
 
18
18
  s.source = { :git => "https://github.com/react-native-webview/react-native-webview.git", :tag => "v#{s.version}" }
19
19
 
@@ -33,17 +33,6 @@ export type WebViewMessageEvent = Readonly<{
33
33
  export type WebViewOpenWindowEvent = Readonly<{
34
34
  targetUrl: string;
35
35
  }>;
36
- export type WebViewHttpErrorEvent = Readonly<{
37
- url: string;
38
- loading: boolean;
39
- title: string;
40
- canGoBack: boolean;
41
- canGoForward: boolean;
42
- lockIdentifier: Double;
43
- description: string;
44
- statusCode: Int32;
45
- }>;
46
-
47
36
  export type WebViewErrorEvent = Readonly<{
48
37
  url: string;
49
38
  loading: boolean;
@@ -136,15 +125,10 @@ type WebViewRenderProcessGoneEvent = Readonly<{
136
125
  didCrash: boolean;
137
126
  }>;
138
127
 
139
- type WebViewDownloadEvent = Readonly<{
140
- downloadUrl: string;
141
- }>;
142
-
143
128
  // type MenuItem = Readonly<{label: string, key: string}>;
144
129
 
145
130
  export interface NativeProps extends ViewProps {
146
131
  // Android only
147
- allowFileAccess?: boolean;
148
132
  allowsProtectedMedia?: boolean;
149
133
  allowsFullscreenVideo?: boolean;
150
134
  androidLayerType?: WithDefault<'none' | 'software' | 'hardware', 'none'>;
@@ -179,11 +163,9 @@ export interface NativeProps extends ViewProps {
179
163
  // !Android only
180
164
 
181
165
  // iOS only
182
- allowingReadAccessToURL?: string;
183
166
  allowsBackForwardNavigationGestures?: boolean;
184
167
  allowsInlineMediaPlayback?: boolean;
185
168
  allowsPictureInPictureMediaPlayback?: boolean;
186
- allowsAirPlayForMediaPlayback?: boolean;
187
169
  allowsLinkPreview?: WithDefault<boolean, true>;
188
170
  automaticallyAdjustContentInsets?: WithDefault<boolean, true>;
189
171
  autoManageStatusBarEnabled?: WithDefault<boolean, true>;
@@ -239,18 +221,11 @@ export interface NativeProps extends ViewProps {
239
221
  useSharedProcessPool?: WithDefault<boolean, true>;
240
222
  onContentProcessDidTerminate?: DirectEventHandler<WebViewNativeEvent>;
241
223
  onCustomMenuSelection?: DirectEventHandler<WebViewCustomMenuSelectionEvent>;
242
- onFileDownload?: DirectEventHandler<WebViewDownloadEvent>;
243
-
244
224
  menuItems?: ReadonlyArray<Readonly<{ label: string; key: string }>>;
245
225
  suppressMenuItems?: Readonly<string>[];
246
- // Workaround to watch if listener if defined
247
- hasOnFileDownload?: boolean;
248
226
  fraudulentWebsiteWarningEnabled?: WithDefault<boolean, true>;
249
227
  // !iOS only
250
228
 
251
- allowFileAccessFromFileURLs?: boolean;
252
- allowUniversalAccessFromFileURLs?: boolean;
253
- applicationNameForUserAgent?: string;
254
229
  basicAuthCredential?: Readonly<{
255
230
  username: string;
256
231
  password: string;
@@ -259,12 +234,6 @@ export interface NativeProps extends ViewProps {
259
234
  incognito?: boolean;
260
235
  injectedJavaScript?: string;
261
236
  injectedJavaScriptBeforeContentLoaded?: string;
262
- injectedJavaScriptForMainFrameOnly?: WithDefault<boolean, true>;
263
- injectedJavaScriptBeforeContentLoadedForMainFrameOnly?: WithDefault<
264
- boolean,
265
- true
266
- >;
267
- javaScriptCanOpenWindowsAutomatically?: boolean;
268
237
  javaScriptEnabled?: WithDefault<boolean, true>;
269
238
  webviewDebuggingEnabled?: boolean;
270
239
  mediaPlaybackRequiresUserAction?: WithDefault<boolean, true>;
@@ -274,7 +243,6 @@ export interface NativeProps extends ViewProps {
274
243
  onLoadingFinish: DirectEventHandler<WebViewNavigationEvent>;
275
244
  onLoadingProgress: DirectEventHandler<WebViewNativeProgressEvent>;
276
245
  onLoadingStart: DirectEventHandler<WebViewNavigationEvent>;
277
- onHttpError: DirectEventHandler<WebViewHttpErrorEvent>;
278
246
  onMessage: DirectEventHandler<WebViewMessageEvent>;
279
247
  onOpenWindow?: DirectEventHandler<WebViewOpenWindowEvent>;
280
248
  hasOnOpenWindowEvent?: boolean;
@@ -302,10 +270,6 @@ export interface NativeCommands {
302
270
  goForward: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
303
271
  reload: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
304
272
  stopLoading: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
305
- injectJavaScript: (
306
- viewRef: React.ElementRef<HostComponent<NativeProps>>,
307
- javascript: string
308
- ) => void;
309
273
  requestFocus: (viewRef: React.ElementRef<HostComponent<NativeProps>>) => void;
310
274
  postMessage: (
311
275
  viewRef: React.ElementRef<HostComponent<NativeProps>>,
@@ -333,7 +297,6 @@ export const Commands = codegenNativeCommands<NativeCommands>({
333
297
  'goForward',
334
298
  'reload',
335
299
  'stopLoading',
336
- 'injectJavaScript',
337
300
  'requestFocus',
338
301
  'postMessage',
339
302
  'loadUrl',