react-native-webview-bootpay 11.26.20 → 13.6.0

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 (342) hide show
  1. package/README.md +9 -31
  2. package/android/build.gradle +70 -112
  3. package/android/gradle.properties +5 -6
  4. package/android/src/main/java/kr/co/bootpay/webview/BPCBasicAuthCredential.java +11 -0
  5. package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +354 -434
  6. package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +350 -259
  7. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +253 -399
  8. package/android/src/main/java/kr/co/bootpay/webview/{WebViewConfig.java → BPCWebViewConfig.java} +3 -4
  9. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewFileProvider.java +1 -1
  10. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManager.java +290 -877
  11. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManagerImpl.kt +664 -0
  12. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModule.java +29 -520
  13. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +554 -0
  14. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewPackage.java +56 -0
  15. package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +122 -0
  16. package/android/src/main/java/kr/co/bootpay/webview/events/TopCustomMenuSelectionEvent.kt +24 -0
  17. package/android/src/main/java/kr/co/bootpay/webview/events/TopNewWindowEvent.kt +25 -0
  18. package/android/src/newarch/com/reactnativecommunity/webview/BPCWebViewManager.java +544 -0
  19. package/android/src/newarch/com/reactnativecommunity/webview/BPCWebViewModule.java +57 -0
  20. package/apple/BPCWebView.h +22 -126
  21. package/apple/BPCWebView.mm +528 -0
  22. package/apple/BPCWebViewDecisionManager.h +20 -0
  23. package/apple/BPCWebViewDecisionManager.m +47 -0
  24. package/apple/BPCWebViewImpl.h +150 -0
  25. package/apple/{BPCWebView.m → BPCWebViewImpl.m} +381 -214
  26. package/apple/BPCWebViewManager.h +4 -8
  27. package/apple/{BPCWebViewManager.m → BPCWebViewManager.mm} +93 -149
  28. package/{android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream → ios/.DS_Store} +0 -0
  29. package/ios/{BPCWebView.xcodeproj → RNCWebView.xcodeproj}/project.pbxproj +18 -18
  30. package/ios/main.jsbundle +457 -0
  31. package/lib/BPCWebViewNativeComponent.d.ts +242 -0
  32. package/lib/BPCWebViewNativeComponent.d.ts.map +1 -0
  33. package/lib/BPCWebViewNativeComponent.js +6 -0
  34. package/lib/NativeBPCWebView.d.ts +10 -0
  35. package/lib/NativeBPCWebView.d.ts.map +1 -0
  36. package/lib/NativeBPCWebView.js +2 -0
  37. package/lib/NativeRNCWebView.d.ts +10 -0
  38. package/lib/NativeRNCWebView.d.ts.map +1 -0
  39. package/lib/NativeRNCWebView.js +2 -0
  40. package/lib/RNCWebViewNativeComponent.d.ts +242 -0
  41. package/lib/RNCWebViewNativeComponent.d.ts.map +1 -0
  42. package/lib/RNCWebViewNativeComponent.js +6 -0
  43. package/lib/WebView.android.d.ts.map +1 -1
  44. package/lib/WebView.android.js +53 -29
  45. package/lib/WebView.ios.d.ts.map +1 -1
  46. package/lib/WebView.ios.js +49 -28
  47. package/lib/WebView.macos.d.ts.map +1 -1
  48. package/lib/WebView.macos.js +10 -14
  49. package/lib/WebView.windows.d.ts.map +1 -1
  50. package/lib/WebView.windows.js +4 -6
  51. package/lib/WebViewNativeComponent.macos.d.ts +2 -2
  52. package/lib/WebViewNativeComponent.macos.js +2 -2
  53. package/lib/WebViewShared.d.ts +4 -2
  54. package/lib/WebViewShared.d.ts.map +1 -1
  55. package/lib/WebViewShared.js +8 -2
  56. package/lib/WebViewTypes.d.ts +62 -95
  57. package/lib/WebViewTypes.d.ts.map +1 -1
  58. package/lib/WebViewTypes.js +0 -16
  59. package/macos/RNCWebView.xcodeproj/project.pbxproj +44 -44
  60. package/package.json +38 -20
  61. package/react-native-webview-bootpay.podspec +22 -3
  62. package/react-native.config.js +1 -2
  63. package/src/BPCWebViewNativeComponent.ts +281 -0
  64. package/src/NativeBPCWebView.ts +14 -0
  65. package/src/WebView.android.tsx +229 -0
  66. package/src/WebView.ios.tsx +232 -0
  67. package/src/WebView.macos.tsx +177 -0
  68. package/src/WebView.styles.ts +44 -0
  69. package/src/WebView.tsx +18 -0
  70. package/src/WebView.windows.tsx +156 -0
  71. package/src/WebViewNativeComponent.macos.ts +8 -0
  72. package/src/WebViewNativeComponent.windows.ts +10 -0
  73. package/src/WebViewShared.tsx +235 -0
  74. package/src/WebViewTypes.ts +1287 -0
  75. package/src/__tests__/WebViewShared-test.js +208 -0
  76. package/src/__tests__/__snapshots__/WebViewShared-test.js.snap +8 -0
  77. package/src/index.ts +4 -0
  78. package/windows/.gitignore +353 -0
  79. package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +1 -1
  80. package/windows/ReactNativeWebView/ReactWebView.idl +1 -0
  81. package/windows/ReactNativeWebView/ReactWebView2.cpp +142 -19
  82. package/windows/ReactNativeWebView/ReactWebView2.h +3 -0
  83. package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +29 -5
  84. package/windows/ReactNativeWebView/pch.h +1 -0
  85. package/android/.editorconfig +0 -6
  86. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/results.bin +0 -1
  87. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.dex +0 -0
  88. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient.dex +0 -0
  89. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$1.dex +0 -0
  90. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.dex +0 -0
  91. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.dex +0 -0
  92. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView.dex +0 -0
  93. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewClient.dex +0 -0
  94. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.dex +0 -0
  95. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$1.dex +0 -0
  96. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$2.dex +0 -0
  97. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$3.dex +0 -0
  98. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$4.dex +0 -0
  99. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager.dex +0 -0
  100. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$1.dex +0 -0
  101. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$2.dex +0 -0
  102. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.dex +0 -0
  103. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.dex +0 -0
  104. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.dex +0 -0
  105. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule.dex +0 -0
  106. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewPackage.dex +0 -0
  107. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BasicAuthCredential.dex +0 -0
  108. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BuildConfig.dex +0 -0
  109. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/URLUtil.dex +0 -0
  110. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/WebViewConfig.dex +0 -0
  111. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.dex +0 -0
  112. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.dex +0 -0
  113. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.dex +0 -0
  114. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.dex +0 -0
  115. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.dex +0 -0
  116. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.dex +0 -0
  117. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.dex +0 -0
  118. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.dex +0 -0
  119. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.dex +0 -0
  120. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.dex +0 -0
  121. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.dex +0 -0
  122. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent.dex +0 -0
  123. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.dex +0 -0
  124. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.dex +0 -0
  125. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.dex +0 -0
  126. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.dex +0 -0
  127. package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/desugar_graph.bin +0 -0
  128. package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/results.bin +0 -1
  129. package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/transformed/classes/classes.dex +0 -0
  130. package/android/build/.transforms/c0e86b44db04fcaf424a5b7ce79324f4/results.bin +0 -1
  131. package/android/build/generated/source/buildConfig/debug/kr/co/bootpay/webview/BuildConfig.java +0 -10
  132. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -106
  133. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
  134. package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
  135. package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
  136. package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
  137. package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
  138. package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -1861
  139. package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
  140. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -2
  141. package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
  142. package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
  143. package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
  144. package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
  145. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
  146. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
  147. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$1.class +0 -0
  148. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.class +0 -0
  149. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.class +0 -0
  150. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView.class +0 -0
  151. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
  152. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewFileProvider.class +0 -0
  153. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$1.class +0 -0
  154. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$2.class +0 -0
  155. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$3.class +0 -0
  156. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
  157. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
  158. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$1.class +0 -0
  159. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$2.class +0 -0
  160. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$MimeType.class +0 -0
  161. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
  162. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
  163. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule.class +0 -0
  164. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
  165. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BuildConfig.class +0 -0
  166. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/URLUtil.class +0 -0
  167. package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/WebViewConfig.class +0 -0
  168. package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
  169. package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -3
  170. package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -210
  171. package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -106
  172. package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
  173. package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
  174. package/android/build/intermediates/packaged_res/debug/xml/file_provider_paths.xml +0 -6
  175. package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
  176. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
  177. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
  178. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$1.class +0 -0
  179. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.class +0 -0
  180. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.class +0 -0
  181. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView.class +0 -0
  182. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
  183. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.class +0 -0
  184. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$1.class +0 -0
  185. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$2.class +0 -0
  186. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$3.class +0 -0
  187. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
  188. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
  189. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$1.class +0 -0
  190. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$2.class +0 -0
  191. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.class +0 -0
  192. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
  193. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
  194. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule.class +0 -0
  195. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
  196. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
  197. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BuildConfig.class +0 -0
  198. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/URLUtil.class +0 -0
  199. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/WebViewConfig.class +0 -0
  200. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
  201. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
  202. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
  203. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
  204. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
  205. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
  206. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
  207. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
  208. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
  209. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
  210. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
  211. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
  212. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
  213. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
  214. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
  215. package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
  216. package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
  217. package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1381
  218. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  219. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
  220. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
  221. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
  222. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  223. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
  224. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
  225. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  226. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  227. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  228. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  229. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  230. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  231. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
  232. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  233. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  234. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  235. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  236. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  237. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  238. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
  239. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  240. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
  241. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
  242. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
  243. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  244. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
  245. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
  246. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  247. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  248. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  249. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  250. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  251. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  252. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
  253. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
  254. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
  255. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
  256. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
  257. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
  258. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
  259. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
  260. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  261. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  262. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  263. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  264. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  265. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  266. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
  267. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  268. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
  269. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
  270. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
  271. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  272. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
  273. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
  274. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  275. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
  276. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
  277. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
  278. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  279. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
  280. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
  281. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  282. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
  283. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
  284. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
  285. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  286. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
  287. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
  288. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
  289. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  290. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
  291. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
  292. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
  293. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  294. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
  295. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
  296. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  297. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  298. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  299. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  300. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  301. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
  302. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  303. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  304. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  305. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  306. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  307. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  308. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  309. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  310. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  311. package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -229
  312. package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
  313. package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
  314. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
  315. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
  316. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
  317. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
  318. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
  319. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
  320. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
  321. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
  322. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
  323. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
  324. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
  325. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
  326. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
  327. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
  328. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
  329. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
  330. package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
  331. package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewPackage.kt +0 -15
  332. package/android/src/main/java/kr/co/bootpay/webview/BasicAuthCredential.java +0 -11
  333. package/ios/BPCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
  334. package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
  335. package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcuserdata/ehowlsla.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
  336. package/ios/BPCWebView.xcodeproj/xcuserdata/ehowlsla.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
  337. package/lib/WebViewNativeComponent.android.d.ts +0 -4
  338. package/lib/WebViewNativeComponent.android.d.ts.map +0 -1
  339. package/lib/WebViewNativeComponent.android.js +0 -3
  340. package/lib/WebViewNativeComponent.ios.d.ts +0 -4
  341. package/lib/WebViewNativeComponent.ios.d.ts.map +0 -1
  342. package/lib/WebViewNativeComponent.ios.js +0 -3
@@ -0,0 +1,208 @@
1
+ import { Linking } from 'react-native';
2
+
3
+ import {
4
+ defaultOriginWhitelist,
5
+ createOnShouldStartLoadWithRequest,
6
+ } from '../WebViewShared';
7
+
8
+ Linking.openURL.mockResolvedValue(undefined);
9
+ Linking.canOpenURL.mockResolvedValue(true);
10
+
11
+ // The tests that call createOnShouldStartLoadWithRequest will cause a promise
12
+ // to get kicked off (by calling the mocked `Linking.canOpenURL`) that the tests
13
+ // _need_ to get run to completion _before_ doing any `expect`ing. The reason
14
+ // is: once that promise is resolved another function should get run which will
15
+ // call `Linking.openURL`, and we want to test that.
16
+ //
17
+ // Normally we would probably do something like `await
18
+ // createShouldStartLoadWithRequest(...)` in the tests, but that doesn't work
19
+ // here because the promise that gets kicked off is not returned (because
20
+ // non-test code doesn't need to know about it).
21
+ //
22
+ // The tests thus need a way to "flush any pending promises" (to make sure
23
+ // pending promises run to completion) before doing any `expect`ing. `jest`
24
+ // doesn't provide a way to do this out of the box, but we can use this function
25
+ // to do it.
26
+ //
27
+ // See this issue for more discussion: https://github.com/facebook/jest/issues/2157
28
+ function flushPromises() {
29
+ return new Promise(resolve => setImmediate(resolve));
30
+ }
31
+
32
+
33
+ describe('WebViewShared', () => {
34
+ test('exports defaultOriginWhitelist', () => {
35
+ expect(defaultOriginWhitelist).toMatchSnapshot();
36
+ });
37
+
38
+ describe('createOnShouldStartLoadWithRequest', () => {
39
+ const alwaysTrueOnShouldStartLoadWithRequest = (nativeEvent) => {
40
+ return true;
41
+ };
42
+
43
+ const alwaysFalseOnShouldStartLoadWithRequest = (nativeEvent) => {
44
+ return false;
45
+ };
46
+
47
+ const loadRequest = jest.fn();
48
+
49
+ test('loadRequest is called without onShouldStartLoadWithRequest override', async () => {
50
+ const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
51
+ loadRequest,
52
+ defaultOriginWhitelist,
53
+ );
54
+
55
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'https://www.example.com/', lockIdentifier: 1 } });
56
+
57
+ await flushPromises();
58
+
59
+ expect(Linking.openURL).toHaveBeenCalledTimes(0);
60
+ expect(loadRequest).toHaveBeenCalledWith(true, 'https://www.example.com/', 1);
61
+ });
62
+
63
+ test('Linking.openURL is called without onShouldStartLoadWithRequest override', async () => {
64
+ const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
65
+ loadRequest,
66
+ defaultOriginWhitelist,
67
+ );
68
+
69
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'invalid://example.com/', lockIdentifier: 2 } });
70
+
71
+ await flushPromises();
72
+
73
+ expect(Linking.openURL).toHaveBeenCalledWith('invalid://example.com/');
74
+ expect(loadRequest).toHaveBeenCalledWith(false, 'invalid://example.com/', 2);
75
+ });
76
+
77
+ test('loadRequest with true onShouldStartLoadWithRequest override is called', async () => {
78
+ const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
79
+ loadRequest,
80
+ defaultOriginWhitelist,
81
+ alwaysTrueOnShouldStartLoadWithRequest,
82
+ );
83
+
84
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'https://www.example.com/', lockIdentifier: 1 } });
85
+
86
+ await flushPromises();
87
+
88
+ expect(Linking.openURL).toHaveBeenCalledTimes(0);
89
+ expect(loadRequest).toHaveBeenLastCalledWith(true, 'https://www.example.com/', 1);
90
+ });
91
+
92
+ test('Linking.openURL with true onShouldStartLoadWithRequest override is called for links not passing the whitelist', async () => {
93
+ const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
94
+ loadRequest,
95
+ defaultOriginWhitelist,
96
+ alwaysTrueOnShouldStartLoadWithRequest,
97
+ );
98
+
99
+ var a = 10;
100
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'invalid://example.com/', lockIdentifier: 1 } });
101
+
102
+ await flushPromises();
103
+
104
+ expect(Linking.openURL).toHaveBeenLastCalledWith('invalid://example.com/');
105
+ // We don't expect the URL to have been loaded in the WebView because it
106
+ // is not in the origin whitelist
107
+ expect(loadRequest).toHaveBeenLastCalledWith(false, 'invalid://example.com/', 1);
108
+ });
109
+
110
+ test('loadRequest with false onShouldStartLoadWithRequest override is called', async () => {
111
+ const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
112
+ loadRequest,
113
+ defaultOriginWhitelist,
114
+ alwaysFalseOnShouldStartLoadWithRequest,
115
+ );
116
+
117
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'https://www.example.com/', lockIdentifier: 1 } });
118
+
119
+ await flushPromises();
120
+
121
+ expect(Linking.openURL).toHaveBeenCalledTimes(0);
122
+ expect(loadRequest).toHaveBeenLastCalledWith(false, 'https://www.example.com/', 1);
123
+ });
124
+
125
+ test('loadRequest with limited whitelist', async () => {
126
+ const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
127
+ loadRequest,
128
+ ['https://*'],
129
+ );
130
+
131
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'https://www.example.com/', lockIdentifier: 1 } });
132
+
133
+ await flushPromises();
134
+
135
+ expect(Linking.openURL).toHaveBeenCalledTimes(0);
136
+ expect(loadRequest).toHaveBeenLastCalledWith(true, 'https://www.example.com/', 1);
137
+
138
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'http://insecure.com/', lockIdentifier: 2 } });
139
+
140
+ await flushPromises();
141
+
142
+ expect(Linking.openURL).toHaveBeenLastCalledWith('http://insecure.com/');
143
+ expect(loadRequest).toHaveBeenLastCalledWith(false, 'http://insecure.com/', 2);
144
+
145
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'git+https://insecure.com/', lockIdentifier: 3 } });
146
+
147
+ await flushPromises();
148
+
149
+ expect(Linking.openURL).toHaveBeenLastCalledWith('git+https://insecure.com/');
150
+ expect(loadRequest).toHaveBeenLastCalledWith(false, 'git+https://insecure.com/', 3);
151
+
152
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'fakehttps://insecure.com/', lockIdentifier: 4 } });
153
+
154
+ await flushPromises();
155
+
156
+ expect(Linking.openURL).toHaveBeenLastCalledWith('fakehttps://insecure.com/');
157
+ expect(loadRequest).toHaveBeenLastCalledWith(false, 'fakehttps://insecure.com/', 4);
158
+ });
159
+
160
+ test('loadRequest allows for valid URIs', async () => {
161
+ const onShouldStartLoadWithRequest = createOnShouldStartLoadWithRequest(
162
+ loadRequest,
163
+ ['plus+https://*', 'DOT.https://*', 'dash-https://*', '0invalid://*', '+invalid://*'],
164
+ );
165
+
166
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'plus+https://www.example.com/', lockIdentifier: 1 } });
167
+
168
+ await flushPromises();
169
+ expect(Linking.openURL).toHaveBeenCalledTimes(0);
170
+ expect(loadRequest).toHaveBeenLastCalledWith(true, 'plus+https://www.example.com/', 1);
171
+
172
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'DOT.https://www.example.com/', lockIdentifier: 2 } });
173
+
174
+ await flushPromises();
175
+
176
+ expect(Linking.openURL).toHaveBeenCalledTimes(0);
177
+ expect(loadRequest).toHaveBeenLastCalledWith(true, 'DOT.https://www.example.com/', 2);
178
+
179
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'dash-https://www.example.com/', lockIdentifier: 3 } });
180
+
181
+ await flushPromises();
182
+
183
+ expect(Linking.openURL).toHaveBeenCalledTimes(0);
184
+ expect(loadRequest).toHaveBeenLastCalledWith(true, 'dash-https://www.example.com/', 3);
185
+
186
+ onShouldStartLoadWithRequest({ nativeEvent: { url: '0invalid://www.example.com/', lockIdentifier: 4 } });
187
+
188
+ await flushPromises();
189
+
190
+ expect(Linking.openURL).toHaveBeenLastCalledWith('0invalid://www.example.com/');
191
+ expect(loadRequest).toHaveBeenLastCalledWith(false, '0invalid://www.example.com/', 4);
192
+
193
+ onShouldStartLoadWithRequest({ nativeEvent: { url: '+invalid://www.example.com/', lockIdentifier: 5 } });
194
+
195
+ await flushPromises();
196
+
197
+ expect(Linking.openURL).toHaveBeenLastCalledWith('+invalid://www.example.com/');
198
+ expect(loadRequest).toHaveBeenLastCalledWith(false, '+invalid://www.example.com/', 5);
199
+
200
+ onShouldStartLoadWithRequest({ nativeEvent: { url: 'FAKE+plus+https://www.example.com/', lockIdentifier: 6 } });
201
+
202
+ await flushPromises();
203
+
204
+ expect(Linking.openURL).toHaveBeenLastCalledWith('FAKE+plus+https://www.example.com/');
205
+ expect(loadRequest).toHaveBeenLastCalledWith(false, 'FAKE+plus+https://www.example.com/', 6);
206
+ });
207
+ });
208
+ });
@@ -0,0 +1,8 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`WebViewShared exports defaultOriginWhitelist 1`] = `
4
+ [
5
+ "http://*",
6
+ "https://*",
7
+ ]
8
+ `;
package/src/index.ts ADDED
@@ -0,0 +1,4 @@
1
+ import WebView from './WebView';
2
+
3
+ export { WebView };
4
+ export default WebView;
@@ -0,0 +1,353 @@
1
+ ## Ignore Visual Studio temporary files, build results, and
2
+ ## files generated by popular Visual Studio add-ons.
3
+ ##
4
+ ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
5
+
6
+ # User-specific files
7
+ *.rsuser
8
+ *.suo
9
+ *.user
10
+ *.userosscache
11
+ *.sln.docstates
12
+
13
+ # User-specific files (MonoDevelop/Xamarin Studio)
14
+ *.userprefs
15
+
16
+ # Mono auto generated files
17
+ mono_crash.*
18
+
19
+ # Build results
20
+ [Dd]ebug/
21
+ [Dd]ebugPublic/
22
+ [Rr]elease/
23
+ [Rr]eleases/
24
+ x64/
25
+ x86/
26
+ [Aa][Rr][Mm]/
27
+ [Aa][Rr][Mm]64/
28
+ bld/
29
+ [Bb]in/
30
+ [Oo]bj/
31
+ [Ll]og/
32
+ [Ll]ogs/
33
+
34
+ # Visual Studio 2015/2017 cache/options directory
35
+ .vs/
36
+ # Uncomment if you have tasks that create the project's static files in wwwroot
37
+ #wwwroot/
38
+
39
+ # Visual Studio 2017 auto generated files
40
+ Generated\ Files/
41
+
42
+ # MSTest test Results
43
+ [Tt]est[Rr]esult*/
44
+ [Bb]uild[Ll]og.*
45
+
46
+ # NUnit
47
+ *.VisualState.xml
48
+ TestResult.xml
49
+ nunit-*.xml
50
+
51
+ # Build Results of an ATL Project
52
+ [Dd]ebugPS/
53
+ [Rr]eleasePS/
54
+ dlldata.c
55
+
56
+ # Benchmark Results
57
+ BenchmarkDotNet.Artifacts/
58
+
59
+ # .NET Core
60
+ project.lock.json
61
+ project.fragment.lock.json
62
+ artifacts/
63
+
64
+ # StyleCop
65
+ StyleCopReport.xml
66
+
67
+ # Files built by Visual Studio
68
+ *_i.c
69
+ *_p.c
70
+ *_h.h
71
+ *.ilk
72
+ *.meta
73
+ *.obj
74
+ *.iobj
75
+ *.pch
76
+ *.pdb
77
+ *.ipdb
78
+ *.pgc
79
+ *.pgd
80
+ *.rsp
81
+ *.sbr
82
+ *.tlb
83
+ *.tli
84
+ *.tlh
85
+ *.tmp
86
+ *.tmp_proj
87
+ *_wpftmp.csproj
88
+ *.log
89
+ *.vspscc
90
+ *.vssscc
91
+ .builds
92
+ *.pidb
93
+ *.svclog
94
+ *.scc
95
+
96
+ # Chutzpah Test files
97
+ _Chutzpah*
98
+
99
+ # Visual C++ cache files
100
+ ipch/
101
+ *.aps
102
+ *.ncb
103
+ *.opendb
104
+ *.opensdf
105
+ *.sdf
106
+ *.cachefile
107
+ *.VC.db
108
+ *.VC.VC.opendb
109
+
110
+ # Visual Studio profiler
111
+ *.psess
112
+ *.vsp
113
+ *.vspx
114
+ *.sap
115
+
116
+ # Visual Studio Trace Files
117
+ *.e2e
118
+
119
+ # TFS 2012 Local Workspace
120
+ $tf/
121
+
122
+ # Guidance Automation Toolkit
123
+ *.gpState
124
+
125
+ # ReSharper is a .NET coding add-in
126
+ _ReSharper*/
127
+ *.[Rr]e[Ss]harper
128
+ *.DotSettings.user
129
+
130
+ # TeamCity is a build add-in
131
+ _TeamCity*
132
+
133
+ # DotCover is a Code Coverage Tool
134
+ *.dotCover
135
+
136
+ # AxoCover is a Code Coverage Tool
137
+ .axoCover/*
138
+ !.axoCover/settings.json
139
+
140
+ # Coverlet is a free, cross platform Code Coverage Tool
141
+ coverage*[.json, .xml, .info]
142
+
143
+ # Visual Studio code coverage results
144
+ *.coverage
145
+ *.coveragexml
146
+
147
+ # NCrunch
148
+ _NCrunch_*
149
+ .*crunch*.local.xml
150
+ nCrunchTemp_*
151
+
152
+ # MightyMoose
153
+ *.mm.*
154
+ AutoTest.Net/
155
+
156
+ # Web workbench (sass)
157
+ .sass-cache/
158
+
159
+ # Installshield output folder
160
+ [Ee]xpress/
161
+
162
+ # DocProject is a documentation generator add-in
163
+ DocProject/buildhelp/
164
+ DocProject/Help/*.HxT
165
+ DocProject/Help/*.HxC
166
+ DocProject/Help/*.hhc
167
+ DocProject/Help/*.hhk
168
+ DocProject/Help/*.hhp
169
+ DocProject/Help/Html2
170
+ DocProject/Help/html
171
+
172
+ # Click-Once directory
173
+ publish/
174
+
175
+ # Publish Web Output
176
+ *.[Pp]ublish.xml
177
+ *.azurePubxml
178
+ # Note: Comment the next line if you want to checkin your web deploy settings,
179
+ # but database connection strings (with potential passwords) will be unencrypted
180
+ *.pubxml
181
+ *.publishproj
182
+
183
+ # Microsoft Azure Web App publish settings. Comment the next line if you want to
184
+ # checkin your Azure Web App publish settings, but sensitive information contained
185
+ # in these scripts will be unencrypted
186
+ PublishScripts/
187
+
188
+ # NuGet Packages
189
+ *.nupkg
190
+ # NuGet Symbol Packages
191
+ *.snupkg
192
+ # The packages folder can be ignored because of Package Restore
193
+ **/[Pp]ackages/*
194
+ # except build/, which is used as an MSBuild target.
195
+ !**/[Pp]ackages/build/
196
+ # Uncomment if necessary however generally it will be regenerated when needed
197
+ #!**/[Pp]ackages/repositories.config
198
+ # NuGet v3's project.json files produces more ignorable files
199
+ *.nuget.props
200
+ *.nuget.targets
201
+
202
+ # Microsoft Azure Build Output
203
+ csx/
204
+ *.build.csdef
205
+
206
+ # Microsoft Azure Emulator
207
+ ecf/
208
+ rcf/
209
+
210
+ # Windows Store app package directories and files
211
+ AppPackages/
212
+ BundleArtifacts/
213
+ Package.StoreAssociation.xml
214
+ _pkginfo.txt
215
+ *.appx
216
+ *.appxbundle
217
+ *.appxupload
218
+
219
+ # Visual Studio cache files
220
+ # files ending in .cache can be ignored
221
+ *.[Cc]ache
222
+ # but keep track of directories ending in .cache
223
+ !?*.[Cc]ache/
224
+
225
+ # Others
226
+ ClientBin/
227
+ ~$*
228
+ *~
229
+ *.dbmdl
230
+ *.dbproj.schemaview
231
+ *.jfm
232
+ *.pfx
233
+ *.publishsettings
234
+ orleans.codegen.cs
235
+
236
+ # Including strong name files can present a security risk
237
+ # (https://github.com/github/gitignore/pull/2483#issue-259490424)
238
+ #*.snk
239
+
240
+ # Since there are multiple workflows, uncomment next line to ignore bower_components
241
+ # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
242
+ #bower_components/
243
+
244
+ # RIA/Silverlight projects
245
+ Generated_Code/
246
+
247
+ # Backup & report files from converting an old project file
248
+ # to a newer Visual Studio version. Backup files are not needed,
249
+ # because we have git ;-)
250
+ _UpgradeReport_Files/
251
+ Backup*/
252
+ UpgradeLog*.XML
253
+ UpgradeLog*.htm
254
+ ServiceFabricBackup/
255
+ *.rptproj.bak
256
+
257
+ # SQL Server files
258
+ *.mdf
259
+ *.ldf
260
+ *.ndf
261
+
262
+ # Business Intelligence projects
263
+ *.rdl.data
264
+ *.bim.layout
265
+ *.bim_*.settings
266
+ *.rptproj.rsuser
267
+ *- [Bb]ackup.rdl
268
+ *- [Bb]ackup ([0-9]).rdl
269
+ *- [Bb]ackup ([0-9][0-9]).rdl
270
+
271
+ # Microsoft Fakes
272
+ FakesAssemblies/
273
+
274
+ # GhostDoc plugin setting file
275
+ *.GhostDoc.xml
276
+
277
+ # Node.js Tools for Visual Studio
278
+ .ntvs_analysis.dat
279
+ node_modules/
280
+
281
+ # Visual Studio 6 build log
282
+ *.plg
283
+
284
+ # Visual Studio 6 workspace options file
285
+ *.opt
286
+
287
+ # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
288
+ *.vbw
289
+
290
+ # Visual Studio LightSwitch build output
291
+ **/*.HTMLClient/GeneratedArtifacts
292
+ **/*.DesktopClient/GeneratedArtifacts
293
+ **/*.DesktopClient/ModelManifest.xml
294
+ **/*.Server/GeneratedArtifacts
295
+ **/*.Server/ModelManifest.xml
296
+ _Pvt_Extensions
297
+
298
+ # Paket dependency manager
299
+ .paket/paket.exe
300
+ paket-files/
301
+
302
+ # FAKE - F# Make
303
+ .fake/
304
+
305
+ # CodeRush personal settings
306
+ .cr/personal
307
+
308
+ # Python Tools for Visual Studio (PTVS)
309
+ __pycache__/
310
+ *.pyc
311
+
312
+ # Cake - Uncomment if you are using it
313
+ # tools/**
314
+ # !tools/packages.config
315
+
316
+ # Tabs Studio
317
+ *.tss
318
+
319
+ # Telerik's JustMock configuration file
320
+ *.jmconfig
321
+
322
+ # BizTalk build output
323
+ *.btp.cs
324
+ *.btm.cs
325
+ *.odx.cs
326
+ *.xsd.cs
327
+
328
+ # OpenCover UI analysis results
329
+ OpenCover/
330
+
331
+ # Azure Stream Analytics local run output
332
+ ASALocalRun/
333
+
334
+ # MSBuild Binary and Structured Log
335
+ *.binlog
336
+
337
+ # NVidia Nsight GPU debugger configuration file
338
+ *.nvuser
339
+
340
+ # MFractors (Xamarin productivity tool) working folder
341
+ .mfractor/
342
+
343
+ # Local History for Visual Studio
344
+ .localhistory/
345
+
346
+ # BeatPulse healthcheck temp database
347
+ healthchecksdb
348
+
349
+ # Backup folder for Package Reference Convert tool in Visual Studio 2017
350
+ MigrationBackup/
351
+
352
+ # Ionide (cross platform F# VS Code tools) working folder
353
+ .ionide/
@@ -15,7 +15,7 @@
15
15
  <ApplicationType>Windows Store</ApplicationType>
16
16
  <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
17
17
  <WindowsTargetPlatformVersion Condition=" '$(WindowsTargetPlatformVersion)' == '' ">10.0</WindowsTargetPlatformVersion>
18
- <WindowsTargetPlatformMinVersion>10.0.15063.0</WindowsTargetPlatformMinVersion>
18
+ <WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>
19
19
  </PropertyGroup>
20
20
  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
21
21
  <ItemGroup Label="ProjectConfigurations">
@@ -15,6 +15,7 @@ namespace ReactNativeWebView{
15
15
  runtimeclass ReactWebView2 : Windows.UI.Xaml.Controls.ContentPresenter{
16
16
  ReactWebView2(Microsoft.ReactNative.IReactContext context);
17
17
  void NavigateToHtml(String html);
18
+ void NavigateWithHeaders(String uri, Windows.Foundation.Collections.IMapView<String, String> headers);
18
19
  Boolean MessagingEnabled;
19
20
  };
20
21
  #endif