react-native-webview-bootpay 11.26.19 → 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,664 @@
1
+ package kr.co.bootpay.webview
2
+
3
+ import android.app.DownloadManager
4
+ import android.content.pm.ActivityInfo
5
+ import android.graphics.Bitmap
6
+ import android.graphics.Color
7
+ import android.net.Uri
8
+ import android.os.Build
9
+ import android.os.Environment
10
+ import android.util.Log
11
+ import android.view.View
12
+ import android.view.ViewGroup
13
+ import android.view.WindowManager
14
+ import android.webkit.CookieManager
15
+ import android.webkit.DownloadListener
16
+ import android.webkit.WebSettings
17
+ import android.webkit.WebView
18
+ import androidx.webkit.WebSettingsCompat
19
+ import androidx.webkit.WebViewFeature
20
+ import com.facebook.react.bridge.ReadableArray
21
+ import com.facebook.react.bridge.ReadableMap
22
+ import com.facebook.react.common.MapBuilder
23
+ import com.facebook.react.common.build.ReactBuildConfig
24
+ import com.facebook.react.uimanager.ThemedReactContext
25
+ import org.json.JSONException
26
+ import org.json.JSONObject
27
+ import java.io.UnsupportedEncodingException
28
+ import java.net.MalformedURLException
29
+ import java.net.URL
30
+ import java.util.*
31
+
32
+ val invalidCharRegex = "[\\\\/%\"]".toRegex()
33
+
34
+ class BPCWebViewManagerImpl {
35
+ companion object {
36
+ const val NAME = "BPCWebView"
37
+ }
38
+
39
+ private val TAG = "BPCWebViewManagerImpl"
40
+ private var mWebViewConfig: BPCWebViewConfig = BPCWebViewConfig { webView: WebView? -> }
41
+ private var mAllowsFullscreenVideo = false
42
+ private var mAllowsProtectedMedia = false
43
+ private var mDownloadingMessage: String? = null
44
+ private var mLackPermissionToDownloadMessage: String? = null
45
+ private var mHasOnOpenWindowEvent = false
46
+
47
+ private var mUserAgent: String? = null
48
+ private var mUserAgentWithApplicationName: String? = null
49
+ private val HTML_ENCODING = "UTF-8"
50
+ private val HTML_MIME_TYPE = "text/html"
51
+ private val HTTP_METHOD_POST = "POST"
52
+
53
+ // Use `webView.loadUrl("about:blank")` to reliably reset the view
54
+ // state and release page resources (including any running JavaScript).
55
+ private val BLANK_URL = "about:blank"
56
+
57
+ private val DEFAULT_DOWNLOADING_MESSAGE = "Downloading"
58
+ private val DEFAULT_LACK_PERMISSION_TO_DOWNLOAD_MESSAGE =
59
+ "Cannot download files as permission was denied. Please provide permission to write to storage, in order to download files."
60
+
61
+ fun createBPCWebViewInstance(context: ThemedReactContext): BPCWebView {
62
+ return BPCWebView(context)
63
+ }
64
+
65
+ fun createViewInstance(context: ThemedReactContext): BPCWebView {
66
+ val webView = createBPCWebViewInstance(context)
67
+ return createViewInstance(context, webView);
68
+ }
69
+
70
+ fun createViewInstance(context: ThemedReactContext, webView: BPCWebView): BPCWebView {
71
+ setupWebChromeClient(webView)
72
+ context.addLifecycleEventListener(webView)
73
+ mWebViewConfig.configWebView(webView)
74
+ val settings = webView.settings
75
+ settings.builtInZoomControls = true
76
+ settings.displayZoomControls = false
77
+ settings.domStorageEnabled = true
78
+ settings.setSupportMultipleWindows(true)
79
+ settings.allowFileAccess = false
80
+ settings.allowContentAccess = false
81
+ settings.allowFileAccessFromFileURLs = false
82
+ setAllowUniversalAccessFromFileURLs(webView, false)
83
+ setMixedContentMode(webView, "never")
84
+
85
+ // Fixes broken full-screen modals/galleries due to body height being 0.
86
+ webView.layoutParams = ViewGroup.LayoutParams(
87
+ ViewGroup.LayoutParams.MATCH_PARENT,
88
+ ViewGroup.LayoutParams.MATCH_PARENT
89
+ )
90
+ if (ReactBuildConfig.DEBUG) {
91
+ WebView.setWebContentsDebuggingEnabled(true)
92
+ }
93
+ webView.setDownloadListener(DownloadListener { url, userAgent, contentDisposition, mimetype, contentLength ->
94
+ webView.setIgnoreErrFailedForThisURL(url)
95
+ val module = webView.themedReactContext.getNativeModule(BPCWebViewModule::class.java) ?: return@DownloadListener
96
+ val request: DownloadManager.Request = try {
97
+ DownloadManager.Request(Uri.parse(url))
98
+ } catch (e: IllegalArgumentException) {
99
+ Log.w(TAG, "Unsupported URI, aborting download", e)
100
+ return@DownloadListener
101
+ }
102
+ var fileName = URLUtil.guessFileName(url, contentDisposition, mimetype)
103
+
104
+ // Sanitize filename by replacing invalid characters with "_"
105
+ fileName = fileName.replace(invalidCharRegex, "_")
106
+
107
+ val downloadMessage = "Downloading $fileName"
108
+
109
+ //Attempt to add cookie, if it exists
110
+ var urlObj: URL? = null
111
+ try {
112
+ urlObj = URL(url)
113
+ val baseUrl = urlObj.protocol + "://" + urlObj.host
114
+ val cookie = CookieManager.getInstance().getCookie(baseUrl)
115
+ request.addRequestHeader("Cookie", cookie)
116
+ } catch (e: MalformedURLException) {
117
+ Log.w(TAG, "Error getting cookie for DownloadManager", e)
118
+ }
119
+
120
+ //Finish setting up request
121
+ request.addRequestHeader("User-Agent", userAgent)
122
+ request.setTitle(fileName)
123
+ request.setDescription(downloadMessage)
124
+ request.allowScanningByMediaScanner()
125
+ request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED)
126
+ request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, fileName)
127
+ module.setDownloadRequest(request)
128
+ if (module.grantFileDownloaderPermissions(
129
+ getDownloadingMessageOrDefault(),
130
+ getLackPermissionToDownloadMessageOrDefault()
131
+ )
132
+ ) {
133
+ module.downloadFile(
134
+ getDownloadingMessageOrDefault()
135
+ )
136
+ }
137
+ })
138
+ return webView
139
+ }
140
+
141
+ private fun setupWebChromeClient(
142
+ webView: BPCWebView,
143
+ ) {
144
+ val activity = webView.themedReactContext.currentActivity
145
+ if (mAllowsFullscreenVideo && activity != null) {
146
+ val initialRequestedOrientation = activity.requestedOrientation
147
+ val webChromeClient: BPCWebChromeClient =
148
+ object : BPCWebChromeClient(webView) {
149
+ override fun getDefaultVideoPoster(): Bitmap? {
150
+ return Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888)
151
+ }
152
+
153
+ override fun onShowCustomView(view: View, callback: CustomViewCallback) {
154
+ if (mVideoView != null) {
155
+ callback.onCustomViewHidden()
156
+ return
157
+ }
158
+ mVideoView = view
159
+ mCustomViewCallback = callback
160
+ activity.requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED
161
+ mVideoView.systemUiVisibility = FULLSCREEN_SYSTEM_UI_VISIBILITY
162
+ activity.window.setFlags(
163
+ WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
164
+ WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
165
+ )
166
+ mVideoView.setBackgroundColor(Color.BLACK)
167
+
168
+ // Since RN's Modals interfere with the View hierarchy
169
+ // we will decide which View to hide if the hierarchy
170
+ // does not match (i.e., the WebView is within a Modal)
171
+ // NOTE: We could use `mWebView.getRootView()` instead of `getRootView()`
172
+ // but that breaks the Modal's styles and layout, so we need this to render
173
+ // in the main View hierarchy regardless
174
+ val rootView = rootView
175
+ rootView.addView(mVideoView, FULLSCREEN_LAYOUT_PARAMS)
176
+
177
+ // Different root views, we are in a Modal
178
+ if (rootView.rootView !== mWebView.rootView) {
179
+ mWebView.rootView.visibility = View.GONE
180
+ } else {
181
+ // Same view hierarchy (no Modal), just hide the WebView then
182
+ mWebView.visibility = View.GONE
183
+ }
184
+ mWebView.themedReactContext.addLifecycleEventListener(this)
185
+ }
186
+
187
+ override fun onHideCustomView() {
188
+ if (mVideoView == null) {
189
+ return
190
+ }
191
+
192
+ // Same logic as above
193
+ val rootView = rootView
194
+ if (rootView.rootView !== mWebView.rootView) {
195
+ mWebView.rootView.visibility = View.VISIBLE
196
+ } else {
197
+ // Same view hierarchy (no Modal)
198
+ mWebView.visibility = View.VISIBLE
199
+ }
200
+ activity.window.clearFlags(WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS)
201
+ rootView.removeView(mVideoView)
202
+ mCustomViewCallback.onCustomViewHidden()
203
+ mVideoView = null
204
+ mCustomViewCallback = null
205
+ activity.requestedOrientation = initialRequestedOrientation
206
+ mWebView.themedReactContext.removeLifecycleEventListener(this)
207
+ }
208
+ }
209
+ webChromeClient.setAllowsProtectedMedia(mAllowsProtectedMedia);
210
+ webChromeClient.setHasOnOpenWindowEvent(mHasOnOpenWindowEvent);
211
+ webView.webChromeClient = webChromeClient
212
+ } else {
213
+ var webChromeClient = webView.webChromeClient as BPCWebChromeClient?
214
+ webChromeClient?.onHideCustomView()
215
+ webChromeClient = object : BPCWebChromeClient(webView) {
216
+ override fun getDefaultVideoPoster(): Bitmap? {
217
+ return Bitmap.createBitmap(50, 50, Bitmap.Config.ARGB_8888)
218
+ }
219
+ }
220
+ webChromeClient.setAllowsProtectedMedia(mAllowsProtectedMedia);
221
+ webChromeClient.setHasOnOpenWindowEvent(mHasOnOpenWindowEvent);
222
+ webView.webChromeClient = webChromeClient
223
+ }
224
+ }
225
+
226
+ fun setUserAgent(view: WebView, userAgent: String?) {
227
+ mUserAgent = userAgent
228
+ setUserAgentString(view)
229
+ }
230
+
231
+ fun setApplicationNameForUserAgent(view: WebView, applicationName: String?) {
232
+ when {
233
+ applicationName != null -> {
234
+ val defaultUserAgent = WebSettings.getDefaultUserAgent(view.context)
235
+ mUserAgentWithApplicationName = "$defaultUserAgent $applicationName"
236
+ }
237
+ else -> {
238
+ mUserAgentWithApplicationName = null
239
+ }
240
+ }
241
+ setUserAgentString(view)
242
+ }
243
+
244
+ private fun setUserAgentString(view: WebView) {
245
+ when {
246
+ mUserAgent != null -> {
247
+ view.settings.userAgentString = mUserAgent
248
+ }
249
+ mUserAgentWithApplicationName != null -> {
250
+ view.settings.userAgentString = mUserAgentWithApplicationName
251
+ }
252
+ else -> {
253
+ view.settings.userAgentString = WebSettings.getDefaultUserAgent(view.context)
254
+ }
255
+ }
256
+ }
257
+
258
+ fun setBasicAuthCredential(view: WebView, credential: ReadableMap?) {
259
+ var basicAuthCredential: BPCBasicAuthCredential? = null
260
+ if (credential != null) {
261
+ if (credential.hasKey("username") && credential.hasKey("password")) {
262
+ val username = credential.getString("username")
263
+ val password = credential.getString("password")
264
+ basicAuthCredential = BPCBasicAuthCredential(username, password)
265
+ }
266
+ }
267
+ (view as BPCWebView).setBasicAuthCredential(basicAuthCredential)
268
+ }
269
+
270
+ fun onDropViewInstance(webView: BPCWebView) {
271
+ webView.themedReactContext.removeLifecycleEventListener(webView)
272
+ webView.cleanupCallbacksAndDestroy()
273
+ webView.mWebChromeClient = null
274
+ }
275
+
276
+ val COMMAND_GO_BACK = 1
277
+ val COMMAND_GO_FORWARD = 2
278
+ val COMMAND_RELOAD = 3
279
+ val COMMAND_STOP_LOADING = 4
280
+ val COMMAND_POST_MESSAGE = 5
281
+ val COMMAND_INJECT_JAVASCRIPT = 6
282
+ val COMMAND_LOAD_URL = 7
283
+ val COMMAND_FOCUS = 8
284
+
285
+ // android commands
286
+ val COMMAND_CLEAR_FORM_DATA = 1000
287
+ val COMMAND_CLEAR_CACHE = 1001
288
+ val COMMAND_CLEAR_HISTORY = 1002
289
+
290
+ fun getCommandsMap(): Map<String, Int>? {
291
+ return MapBuilder.builder<String, Int>()
292
+ .put("goBack", COMMAND_GO_BACK)
293
+ .put("goForward", COMMAND_GO_FORWARD)
294
+ .put("reload", COMMAND_RELOAD)
295
+ .put("stopLoading", COMMAND_STOP_LOADING)
296
+ .put("postMessage", COMMAND_POST_MESSAGE)
297
+ .put("injectJavaScript", COMMAND_INJECT_JAVASCRIPT)
298
+ .put("loadUrl", COMMAND_LOAD_URL)
299
+ .put("requestFocus", COMMAND_FOCUS)
300
+ .put("clearFormData", COMMAND_CLEAR_FORM_DATA)
301
+ .put("clearCache", COMMAND_CLEAR_CACHE)
302
+ .put("clearHistory", COMMAND_CLEAR_HISTORY)
303
+ .build()
304
+ }
305
+
306
+ fun receiveCommand(webView: BPCWebView, commandId: String, args: ReadableArray) {
307
+ when (commandId) {
308
+ "goBack" -> webView.goBack()
309
+ "goForward" -> webView.goForward()
310
+ "reload" -> webView.reload()
311
+ "stopLoading" -> webView.stopLoading()
312
+ "postMessage" -> try {
313
+ val eventInitDict = JSONObject()
314
+ eventInitDict.put("data", args.getString(0))
315
+ webView.evaluateJavascriptWithFallback(
316
+ "(function () {" +
317
+ "var event;" +
318
+ "var data = " + eventInitDict.toString() + ";" +
319
+ "try {" +
320
+ "event = new MessageEvent('message', data);" +
321
+ "} catch (e) {" +
322
+ "event = document.createEvent('MessageEvent');" +
323
+ "event.initMessageEvent('message', true, true, data.data, data.origin, data.lastEventId, data.source);" +
324
+ "}" +
325
+ "document.dispatchEvent(event);" +
326
+ "})();"
327
+ )
328
+ } catch (e: JSONException) {
329
+ throw RuntimeException(e)
330
+ }
331
+ "injectJavaScript" -> webView.evaluateJavascriptWithFallback(args.getString(0))
332
+ "loadUrl" -> {
333
+ if (args == null) {
334
+ throw RuntimeException("Arguments for loading an url are null!")
335
+ }
336
+ webView.progressChangedFilter.setWaitingForCommandLoadUrl(false)
337
+ webView.loadUrl(args.getString(0))
338
+ }
339
+ "requestFocus" -> webView.requestFocus()
340
+ "clearFormData" -> webView.clearFormData()
341
+ "clearCache" -> {
342
+ val includeDiskFiles = args != null && args.getBoolean(0)
343
+ webView.clearCache(includeDiskFiles)
344
+ }
345
+ "clearHistory" -> webView.clearHistory()
346
+ }
347
+ }
348
+
349
+ fun setMixedContentMode(view: WebView, mixedContentMode: String?) {
350
+ if (mixedContentMode == null || "never" == mixedContentMode) {
351
+ view.settings.mixedContentMode = WebSettings.MIXED_CONTENT_NEVER_ALLOW
352
+ } else if ("always" == mixedContentMode) {
353
+ view.settings.mixedContentMode = WebSettings.MIXED_CONTENT_ALWAYS_ALLOW
354
+ } else if ("compatibility" == mixedContentMode) {
355
+ view.settings.mixedContentMode = WebSettings.MIXED_CONTENT_COMPATIBILITY_MODE
356
+ }
357
+ }
358
+
359
+ fun setAllowUniversalAccessFromFileURLs(view: WebView, allow: Boolean) {
360
+ view.settings.allowUniversalAccessFromFileURLs = allow
361
+ }
362
+
363
+ private fun getDownloadingMessageOrDefault(): String? {
364
+ return mDownloadingMessage ?: DEFAULT_DOWNLOADING_MESSAGE
365
+ }
366
+
367
+ private fun getLackPermissionToDownloadMessageOrDefault(): String? {
368
+ return mLackPermissionToDownloadMessage
369
+ ?: DEFAULT_LACK_PERMISSION_TO_DOWNLOAD_MESSAGE
370
+ }
371
+
372
+ fun setSource(view: BPCWebView, source: ReadableMap?, newArch: Boolean = true) {
373
+ if (source != null) {
374
+ if (source.hasKey("html")) {
375
+ val html = source.getString("html")
376
+ val baseUrl = if (source.hasKey("baseUrl")) source.getString("baseUrl") else ""
377
+ view.loadDataWithBaseURL(
378
+ baseUrl,
379
+ html!!,
380
+ HTML_MIME_TYPE,
381
+ HTML_ENCODING,
382
+ null
383
+ )
384
+ return
385
+ }
386
+ if (source.hasKey("uri")) {
387
+ val url = source.getString("uri")
388
+ val previousUrl = view.url
389
+ if (previousUrl != null && previousUrl == url) {
390
+ return
391
+ }
392
+ if (source.hasKey("method")) {
393
+ val method = source.getString("method")
394
+ if (method.equals(HTTP_METHOD_POST, ignoreCase = true)) {
395
+ var postData: ByteArray? = null
396
+ if (source.hasKey("body")) {
397
+ val body = source.getString("body")
398
+ postData = try {
399
+ body!!.toByteArray(charset("UTF-8"))
400
+ } catch (e: UnsupportedEncodingException) {
401
+ body!!.toByteArray()
402
+ }
403
+ }
404
+ if (postData == null) {
405
+ postData = ByteArray(0)
406
+ }
407
+ view.postUrl(url!!, postData)
408
+ return
409
+ }
410
+ }
411
+ val headerMap = HashMap<String, String?>()
412
+ if (source.hasKey("headers")) {
413
+ if (newArch) {
414
+ val headerArray = source.getArray("headers");
415
+ for (header in headerArray!!.toArrayList()) {
416
+ val headerCasted = header as HashMap<String, String>
417
+ val name = headerCasted.get("name") ?: ""
418
+ val value = headerCasted.get("value") ?: ""
419
+ if ("user-agent" == name.lowercase(Locale.ENGLISH)) {
420
+ view.settings.userAgentString = value
421
+ } else {
422
+ headerMap[name] = value
423
+ }
424
+ }
425
+ } else {
426
+ val headers = source.getMap("headers")
427
+ val iter = headers!!.keySetIterator()
428
+ while (iter.hasNextKey()) {
429
+ val key = iter.nextKey()
430
+ if ("user-agent" == key.lowercase(Locale.ENGLISH)) {
431
+ view.settings.userAgentString = headers.getString(key)
432
+ } else {
433
+ headerMap[key] = headers.getString(key)
434
+ }
435
+ }
436
+ }
437
+ }
438
+ view.loadUrl(url!!, headerMap)
439
+ return
440
+ }
441
+ }
442
+ view.loadUrl(BLANK_URL)
443
+ }
444
+
445
+ fun setMessagingModuleName(view: BPCWebView, value: String?) {
446
+ view.messagingModuleName = value
447
+ }
448
+
449
+ fun setCacheEnabled(view: BPCWebView, enabled: Boolean) {
450
+ view.settings.cacheMode = if (enabled) WebSettings.LOAD_DEFAULT else WebSettings.LOAD_NO_CACHE
451
+ }
452
+
453
+ fun setIncognito(view: BPCWebView, enabled: Boolean) {
454
+ // Don't do anything when incognito is disabled
455
+ if (!enabled) {
456
+ return;
457
+ }
458
+
459
+ // Remove all previous cookies
460
+ CookieManager.getInstance().removeAllCookies(null);
461
+
462
+ // Disable caching
463
+ view.settings.cacheMode = WebSettings.LOAD_NO_CACHE
464
+ view.clearHistory();
465
+ view.clearCache(true);
466
+
467
+ // No form data or autofill enabled
468
+ view.clearFormData();
469
+ view.settings.savePassword = false;
470
+ view.settings.saveFormData = false;
471
+ }
472
+
473
+ fun setInjectedJavaScript(view: BPCWebView, injectedJavaScript: String?) {
474
+ view.injectedJS = injectedJavaScript
475
+ }
476
+
477
+ fun setInjectedJavaScriptBeforeContentLoaded(view: BPCWebView, value: String?) {
478
+ view.injectedJSBeforeContentLoaded = value
479
+ }
480
+
481
+ fun setInjectedJavaScriptForMainFrameOnly(view: BPCWebView, value: Boolean) {
482
+ view.injectedJavaScriptForMainFrameOnly = value
483
+ }
484
+
485
+ fun setInjectedJavaScriptBeforeContentLoadedForMainFrameOnly(view: BPCWebView, value: Boolean) {
486
+ view.injectedJavaScriptBeforeContentLoadedForMainFrameOnly = value
487
+ }
488
+
489
+ fun setInjectedJavaScriptObject(view: BPCWebView, value: String?) {
490
+ view.setInjectedJavaScriptObject(value)
491
+ }
492
+
493
+ fun setJavaScriptCanOpenWindowsAutomatically(view: BPCWebView, value: Boolean) {
494
+ view.settings.javaScriptCanOpenWindowsAutomatically = value
495
+ }
496
+
497
+ fun setShowsVerticalScrollIndicator(view: BPCWebView, value: Boolean) {
498
+ view.isVerticalScrollBarEnabled = value
499
+ }
500
+
501
+ fun setShowsHorizontalScrollIndicator(view: BPCWebView, value: Boolean) {
502
+ view.isHorizontalScrollBarEnabled = value
503
+ }
504
+
505
+ fun setMessagingEnabled(view: BPCWebView, value: Boolean) {
506
+ view.setMessagingEnabled(value)
507
+ }
508
+
509
+ fun setMediaPlaybackRequiresUserAction(view: BPCWebView, value: Boolean) {
510
+ view.settings.mediaPlaybackRequiresUserGesture = value
511
+ }
512
+
513
+ fun setHasOnScroll(view: BPCWebView, value: Boolean) {
514
+ view.setHasScrollEvent(value)
515
+ }
516
+
517
+ fun setJavaScriptEnabled(view: BPCWebView, enabled: Boolean) {
518
+ view.settings.javaScriptEnabled = enabled
519
+ }
520
+
521
+ fun setAllowFileAccess(view: BPCWebView, allowFileAccess: Boolean) {
522
+ view.settings.allowFileAccess = allowFileAccess;
523
+ }
524
+
525
+ fun setAllowFileAccessFromFileURLs(view: BPCWebView, value: Boolean) {
526
+ view.settings.allowFileAccessFromFileURLs = value;
527
+ }
528
+
529
+ fun setAllowsFullscreenVideo(view: BPCWebView, value: Boolean) {
530
+ mAllowsFullscreenVideo = value
531
+ setupWebChromeClient(view)
532
+ }
533
+
534
+ fun setAndroidLayerType(view: BPCWebView, layerTypeString: String?) {
535
+ val layerType = when (layerTypeString) {
536
+ "hardware" -> View.LAYER_TYPE_HARDWARE
537
+ "software" -> View.LAYER_TYPE_SOFTWARE
538
+ else -> View.LAYER_TYPE_NONE
539
+ }
540
+ view.setLayerType(layerType, null)
541
+ }
542
+
543
+ fun setCacheMode(view: BPCWebView, cacheModeString: String?) {
544
+ view.settings.cacheMode = when (cacheModeString) {
545
+ "LOAD_CACHE_ONLY" -> WebSettings.LOAD_CACHE_ONLY
546
+ "LOAD_CACHE_ELSE_NETWORK" -> WebSettings.LOAD_CACHE_ELSE_NETWORK
547
+ "LOAD_NO_CACHE" -> WebSettings.LOAD_NO_CACHE
548
+ "LOAD_DEFAULT" -> WebSettings.LOAD_DEFAULT
549
+ else -> WebSettings.LOAD_DEFAULT
550
+ }
551
+ }
552
+
553
+ fun setDomStorageEnabled(view: BPCWebView, value: Boolean) {
554
+ view.settings.domStorageEnabled = value
555
+ }
556
+
557
+ fun setDownloadingMessage(value: String?) {
558
+ mDownloadingMessage = value
559
+ }
560
+
561
+ fun setForceDarkOn(view: BPCWebView, enabled: Boolean) {
562
+ // Only Android 10+ support dark mode
563
+ if (Build.VERSION.SDK_INT > Build.VERSION_CODES.P) {
564
+ if (WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK)) {
565
+ val forceDarkMode =
566
+ if (enabled) WebSettingsCompat.FORCE_DARK_ON else WebSettingsCompat.FORCE_DARK_OFF
567
+ WebSettingsCompat.setForceDark(view.settings, forceDarkMode)
568
+ }
569
+
570
+ // Set how WebView content should be darkened.
571
+ // PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING: checks for the "color-scheme" <meta> tag.
572
+ // If present, it uses media queries. If absent, it applies user-agent (automatic)
573
+ // More information about Force Dark Strategy can be found here:
574
+ // https://developer.android.com/reference/androidx/webkit/WebSettingsCompat#setForceDarkStrategy(android.webkit.WebSettings)
575
+ if (enabled && WebViewFeature.isFeatureSupported(WebViewFeature.FORCE_DARK_STRATEGY)) {
576
+ WebSettingsCompat.setForceDarkStrategy(
577
+ view.settings,
578
+ WebSettingsCompat.DARK_STRATEGY_PREFER_WEB_THEME_OVER_USER_AGENT_DARKENING
579
+ )
580
+ }
581
+ }
582
+ }
583
+
584
+ fun setGeolocationEnabled(view: BPCWebView, value: Boolean) {
585
+ view.settings.setGeolocationEnabled(value)
586
+ }
587
+
588
+ fun setLackPermissionToDownloadMessage(value: String?) {
589
+ mLackPermissionToDownloadMessage = value
590
+ }
591
+
592
+ fun setHasOnOpenWindowEvent(view: BPCWebView, value: Boolean) {
593
+ mHasOnOpenWindowEvent = value
594
+ setupWebChromeClient(view)
595
+ }
596
+
597
+ fun setMinimumFontSize(view: BPCWebView, value: Int) {
598
+ view.settings.minimumFontSize = value
599
+ }
600
+
601
+ fun setAllowsProtectedMedia(view: BPCWebView, enabled: Boolean) {
602
+ // This variable is used to keep consistency
603
+ // in case a new WebChromeClient is created
604
+ // (eg. when mAllowsFullScreenVideo changes)
605
+ mAllowsProtectedMedia = enabled
606
+ if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
607
+ val client = view.webChromeClient
608
+ if (client != null && client is BPCWebChromeClient) {
609
+ client.setAllowsProtectedMedia(enabled)
610
+ }
611
+ }
612
+ }
613
+
614
+ fun setMenuCustomItems(view: BPCWebView, value: ReadableArray) {
615
+ view.setMenuCustomItems(value.toArrayList() as List<Map<String, String>>)
616
+ }
617
+
618
+ fun setNestedScrollEnabled(view: BPCWebView, value: Boolean) {
619
+ view.nestedScrollEnabled = value
620
+ }
621
+
622
+ fun setOverScrollMode(view: BPCWebView, overScrollModeString: String?) {
623
+ view.overScrollMode = when (overScrollModeString) {
624
+ "never" -> View.OVER_SCROLL_NEVER
625
+ "content" -> View.OVER_SCROLL_IF_CONTENT_SCROLLS
626
+ "always" -> View.OVER_SCROLL_ALWAYS
627
+ else -> View.OVER_SCROLL_ALWAYS
628
+ }
629
+ }
630
+
631
+ fun setSaveFormDataDisabled(view: BPCWebView, disabled: Boolean) {
632
+ view.settings.saveFormData = !disabled
633
+ }
634
+
635
+ fun setScalesPageToFit(view: BPCWebView, value: Boolean) {
636
+ view.settings.loadWithOverviewMode = value
637
+ view.settings.useWideViewPort = value
638
+ }
639
+
640
+ fun setSetBuiltInZoomControls(view: BPCWebView, value: Boolean) {
641
+ view.settings.builtInZoomControls = value
642
+ }
643
+
644
+ fun setSetDisplayZoomControls(view: BPCWebView, value: Boolean) {
645
+ view.settings.displayZoomControls = value
646
+
647
+ }
648
+
649
+ fun setSetSupportMultipleWindows(view: BPCWebView, value: Boolean) {
650
+ view.settings.setSupportMultipleWindows(value)
651
+ }
652
+
653
+ fun setTextZoom(view: BPCWebView, value: Int) {
654
+ view.settings.textZoom = value
655
+ }
656
+
657
+ fun setThirdPartyCookiesEnabled(view: BPCWebView, enabled: Boolean) {
658
+ CookieManager.getInstance().setAcceptThirdPartyCookies(view, enabled)
659
+ }
660
+
661
+ fun setWebviewDebuggingEnabled(view: BPCWebView, enabled: Boolean) {
662
+ BPCWebView.setWebContentsDebuggingEnabled(enabled)
663
+ }
664
+ }