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.
- package/README.md +9 -31
- package/android/build.gradle +70 -112
- package/android/gradle.properties +5 -6
- package/android/src/main/java/kr/co/bootpay/webview/BPCBasicAuthCredential.java +11 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +354 -434
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +350 -259
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +253 -399
- package/android/src/main/java/kr/co/bootpay/webview/{WebViewConfig.java → BPCWebViewConfig.java} +3 -4
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewFileProvider.java +1 -1
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManager.java +290 -877
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManagerImpl.kt +664 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModule.java +29 -520
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +554 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewPackage.java +56 -0
- package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +122 -0
- package/android/src/main/java/kr/co/bootpay/webview/events/TopCustomMenuSelectionEvent.kt +24 -0
- package/android/src/main/java/kr/co/bootpay/webview/events/TopNewWindowEvent.kt +25 -0
- package/android/src/newarch/com/reactnativecommunity/webview/BPCWebViewManager.java +544 -0
- package/android/src/newarch/com/reactnativecommunity/webview/BPCWebViewModule.java +57 -0
- package/apple/BPCWebView.h +22 -126
- package/apple/BPCWebView.mm +528 -0
- package/apple/BPCWebViewDecisionManager.h +20 -0
- package/apple/BPCWebViewDecisionManager.m +47 -0
- package/apple/BPCWebViewImpl.h +150 -0
- package/apple/{BPCWebView.m → BPCWebViewImpl.m} +381 -214
- package/apple/BPCWebViewManager.h +4 -8
- package/apple/{BPCWebViewManager.m → BPCWebViewManager.mm} +93 -149
- package/{android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream → ios/.DS_Store} +0 -0
- package/ios/{BPCWebView.xcodeproj → RNCWebView.xcodeproj}/project.pbxproj +18 -18
- package/ios/main.jsbundle +457 -0
- package/lib/BPCWebViewNativeComponent.d.ts +242 -0
- package/lib/BPCWebViewNativeComponent.d.ts.map +1 -0
- package/lib/BPCWebViewNativeComponent.js +6 -0
- package/lib/NativeBPCWebView.d.ts +10 -0
- package/lib/NativeBPCWebView.d.ts.map +1 -0
- package/lib/NativeBPCWebView.js +2 -0
- package/lib/NativeRNCWebView.d.ts +10 -0
- package/lib/NativeRNCWebView.d.ts.map +1 -0
- package/lib/NativeRNCWebView.js +2 -0
- package/lib/RNCWebViewNativeComponent.d.ts +242 -0
- package/lib/RNCWebViewNativeComponent.d.ts.map +1 -0
- package/lib/RNCWebViewNativeComponent.js +6 -0
- package/lib/WebView.android.d.ts.map +1 -1
- package/lib/WebView.android.js +53 -29
- package/lib/WebView.ios.d.ts.map +1 -1
- package/lib/WebView.ios.js +49 -28
- package/lib/WebView.macos.d.ts.map +1 -1
- package/lib/WebView.macos.js +10 -14
- package/lib/WebView.windows.d.ts.map +1 -1
- package/lib/WebView.windows.js +4 -6
- package/lib/WebViewNativeComponent.macos.d.ts +2 -2
- package/lib/WebViewNativeComponent.macos.js +2 -2
- package/lib/WebViewShared.d.ts +4 -2
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewShared.js +8 -2
- package/lib/WebViewTypes.d.ts +62 -95
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/lib/WebViewTypes.js +0 -16
- package/macos/RNCWebView.xcodeproj/project.pbxproj +44 -44
- package/package.json +38 -20
- package/react-native-webview-bootpay.podspec +22 -3
- package/react-native.config.js +1 -2
- package/src/BPCWebViewNativeComponent.ts +281 -0
- package/src/NativeBPCWebView.ts +14 -0
- package/src/WebView.android.tsx +229 -0
- package/src/WebView.ios.tsx +232 -0
- package/src/WebView.macos.tsx +177 -0
- package/src/WebView.styles.ts +44 -0
- package/src/WebView.tsx +18 -0
- package/src/WebView.windows.tsx +156 -0
- package/src/WebViewNativeComponent.macos.ts +8 -0
- package/src/WebViewNativeComponent.windows.ts +10 -0
- package/src/WebViewShared.tsx +235 -0
- package/src/WebViewTypes.ts +1287 -0
- package/src/__tests__/WebViewShared-test.js +208 -0
- package/src/__tests__/__snapshots__/WebViewShared-test.js.snap +8 -0
- package/src/index.ts +4 -0
- package/windows/.gitignore +353 -0
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +1 -1
- package/windows/ReactNativeWebView/ReactWebView.idl +1 -0
- package/windows/ReactNativeWebView/ReactWebView2.cpp +142 -19
- package/windows/ReactNativeWebView/ReactWebView2.h +3 -0
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +29 -5
- package/windows/ReactNativeWebView/pch.h +1 -0
- package/android/.editorconfig +0 -6
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/results.bin +0 -1
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebView.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewClient.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$2.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$3.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$4.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$1.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$2.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BPCWebViewPackage.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BasicAuthCredential.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/BuildConfig.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/URLUtil.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/WebViewConfig.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.dex +0 -0
- package/android/build/.transforms/547b28b34bd585663252523c1a7a53e6/transformed/desugar_graph.bin +0 -0
- package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/results.bin +0 -1
- package/android/build/.transforms/88c49d67076e4458a9ddee82f875eb6a/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/c0e86b44db04fcaf424a5b7ce79324f4/results.bin +0 -1
- package/android/build/generated/source/buildConfig/debug/kr/co/bootpay/webview/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -106
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -1861
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -2
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewFileProvider.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$3.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$MimeType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BPCWebViewModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/URLUtil.class +0 -0
- package/android/build/intermediates/javac/debug/classes/kr/co/bootpay/webview/WebViewConfig.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -3
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -210
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -106
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
- package/android/build/intermediates/packaged_res/debug/xml/file_provider_paths.xml +0 -6
- package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebChromeClient.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebView.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewClient.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$3.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager$4.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewManager.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$1.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$2.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewModule.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BasicAuthCredential.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/BuildConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/URLUtil.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/WebViewConfig.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1381
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/java-sources-proto-map.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -229
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview-bootpay_debug.kotlin_module +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/BPCWebViewPackage.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopMessageEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewPackage.kt +0 -15
- package/android/src/main/java/kr/co/bootpay/webview/BasicAuthCredential.java +0 -11
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +0 -7
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +0 -8
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcuserdata/ehowlsla.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/BPCWebView.xcodeproj/xcuserdata/ehowlsla.xcuserdatad/xcschemes/xcschememanagement.plist +0 -14
- package/lib/WebViewNativeComponent.android.d.ts +0 -4
- package/lib/WebViewNativeComponent.android.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.android.js +0 -3
- package/lib/WebViewNativeComponent.ios.d.ts +0 -4
- package/lib/WebViewNativeComponent.ios.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.ios.js +0 -3
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
package kr.co.bootpay.webview;
|
|
2
2
|
|
|
3
3
|
import android.annotation.TargetApi;
|
|
4
|
-
import android.content.Context;
|
|
5
|
-
import android.content.Intent;
|
|
6
|
-
import android.content.pm.PackageManager;
|
|
7
4
|
import android.graphics.Bitmap;
|
|
8
|
-
import android.net.Uri;
|
|
9
5
|
import android.net.http.SslError;
|
|
10
6
|
import android.os.Build;
|
|
11
7
|
import android.os.SystemClock;
|
|
@@ -27,10 +23,8 @@ import com.facebook.react.bridge.Arguments;
|
|
|
27
23
|
import com.facebook.react.bridge.ReactContext;
|
|
28
24
|
import com.facebook.react.bridge.ReadableArray;
|
|
29
25
|
import com.facebook.react.bridge.WritableMap;
|
|
30
|
-
|
|
31
|
-
import
|
|
32
|
-
import java.util.concurrent.atomic.AtomicReference;
|
|
33
|
-
|
|
26
|
+
import com.facebook.react.uimanager.ThemedReactContext;
|
|
27
|
+
import com.facebook.react.uimanager.UIManagerHelper;
|
|
34
28
|
import kr.co.bootpay.webview.events.TopHttpErrorEvent;
|
|
35
29
|
import kr.co.bootpay.webview.events.TopLoadingErrorEvent;
|
|
36
30
|
import kr.co.bootpay.webview.events.TopLoadingFinishEvent;
|
|
@@ -38,434 +32,294 @@ import kr.co.bootpay.webview.events.TopLoadingStartEvent;
|
|
|
38
32
|
import kr.co.bootpay.webview.events.TopRenderProcessGoneEvent;
|
|
39
33
|
import kr.co.bootpay.webview.events.TopShouldStartLoadWithRequestEvent;
|
|
40
34
|
|
|
41
|
-
|
|
35
|
+
import java.util.concurrent.atomic.AtomicReference;
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
public class BPCWebViewClient extends WebViewClient {
|
|
38
|
+
private static String TAG = "BPCWebViewClient";
|
|
39
|
+
protected static final int SHOULD_OVERRIDE_URL_LOADING_TIMEOUT = 250;
|
|
46
40
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
protected Boolean isSpecialCase(String url) {
|
|
56
|
-
return url.matches("^shinhan\\S+$")
|
|
57
|
-
|| url.startsWith("kftc-bankpay://")
|
|
58
|
-
|| url.startsWith("v3mobileplusweb://")
|
|
59
|
-
|| url.startsWith("hdcardappcardansimclick://")
|
|
60
|
-
|| url.startsWith("nidlogin://")
|
|
61
|
-
|| url.startsWith("mpocket.online.ansimclick://")
|
|
62
|
-
|| url.startsWith("wooripay://")
|
|
63
|
-
|| url.startsWith("kakaotalk://");
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
protected Boolean isIntent(String url) {
|
|
67
|
-
return url.startsWith("intent:");
|
|
68
|
-
}
|
|
69
|
-
protected Boolean isMarket(String url) {
|
|
70
|
-
return url.startsWith("market://");
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
protected Intent getIntentWithPackage(String url) {
|
|
75
|
-
try {
|
|
76
|
-
Intent intent = Intent.parseUri(url, Intent.URI_INTENT_SCHEME);
|
|
77
|
-
if(intent.getPackage() == null) {
|
|
78
|
-
if (url == null) return intent;
|
|
79
|
-
if (url.startsWith("shinhan-sr-ansimclick")) intent.setPackage("com.shcard.smartpay");
|
|
80
|
-
else if (url.startsWith("kftc-bankpay")) intent.setPackage("com.kftc.bankpay.android");
|
|
81
|
-
else if (url.startsWith("ispmobile")) intent.setPackage("kvp.jjy.MispAndroid320");
|
|
82
|
-
else if (url.startsWith("hdcardappcardansimclick")) intent.setPackage("com.hyundaicard.appcard");
|
|
83
|
-
else if (url.startsWith("kb-acp")) intent.setPackage("com.kbcard.kbkookmincard");
|
|
84
|
-
else if (url.startsWith("mpocket.online.ansimclick")) intent.setPackage("kr.co.samsungcard.mpocket");
|
|
85
|
-
else if (url.startsWith("lotteappcard")) intent.setPackage("com.lcacApp");
|
|
86
|
-
else if (url.startsWith("cloudpay")) intent.setPackage("com.hanaskcard.paycla");
|
|
87
|
-
else if (url.startsWith("nhappvardansimclick")) intent.setPackage("nh.smart.nhallonepay");
|
|
88
|
-
else if (url.startsWith("citispay")) intent.setPackage("kr.co.citibank.citimobile");
|
|
89
|
-
else if (url.startsWith("kakaotalk")) intent.setPackage("com.kakao.talk");
|
|
90
|
-
else if (url.startsWith("newliiv")) intent.setPackage("com.kbstar.reboot");
|
|
91
|
-
else if (url.startsWith("kbbank")) intent.setPackage("com.kbstar.kbbank");
|
|
41
|
+
protected boolean mLastLoadFailed = false;
|
|
42
|
+
protected BPCWebView.ProgressChangedFilter progressChangedFilter = null;
|
|
43
|
+
protected @Nullable String ignoreErrFailedForThisURL = null;
|
|
44
|
+
protected @Nullable BPCBasicAuthCredential basicAuthCredential = null;
|
|
92
45
|
|
|
46
|
+
public void setIgnoreErrFailedForThisURL(@Nullable String url) {
|
|
47
|
+
ignoreErrFailedForThisURL = url;
|
|
48
|
+
}
|
|
93
49
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
} catch (URISyntaxException e) {
|
|
97
|
-
e.printStackTrace();
|
|
98
|
-
return null;
|
|
50
|
+
public void setBasicAuthCredential(@Nullable BPCBasicAuthCredential credential) {
|
|
51
|
+
basicAuthCredential = credential;
|
|
99
52
|
}
|
|
100
|
-
}
|
|
101
53
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
54
|
+
@Override
|
|
55
|
+
public void onPageFinished(WebView webView, String url) {
|
|
56
|
+
super.onPageFinished(webView, url);
|
|
105
57
|
|
|
58
|
+
if (!mLastLoadFailed) {
|
|
59
|
+
BPCWebView reactWebView = (BPCWebView) webView;
|
|
106
60
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
e.printStackTrace();
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
protected boolean isExistLaunchedIntent(Intent intent, Context context) {
|
|
117
|
-
return intent != null && intent.getPackage() != null && context.getPackageManager().getLaunchIntentForPackage(intent.getPackage()) != null;
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
protected boolean startApp(Intent intent, Context context) {
|
|
121
|
-
intent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
122
|
-
intent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
123
|
-
context.startActivity(intent);
|
|
124
|
-
return true;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
protected boolean startGooglePlay(Intent intent, Context context) {
|
|
128
|
-
final String appPackageName = intent.getPackage();
|
|
129
|
-
|
|
130
|
-
if(appPackageName == null) {
|
|
131
|
-
Uri dataUri = intent.getData();
|
|
132
|
-
|
|
133
|
-
try {
|
|
134
|
-
Intent addIntent = new Intent(Intent.ACTION_VIEW, intent.getData());
|
|
135
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
136
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
137
|
-
context.startActivity(addIntent);
|
|
138
|
-
} catch (Exception e) {
|
|
139
|
-
String packageName = "com.nhn.android.search"; //appPackageName이 비어있으면 네이버로 보내기(네이버 로그인)
|
|
140
|
-
if(dataUri != null && dataUri.toString().startsWith("wooripay://")) packageName = "com.wooricard.wpay"; //우리카드 예외처리
|
|
141
|
-
|
|
142
|
-
Intent addIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName));
|
|
143
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_CLEAR_TASK);
|
|
144
|
-
addIntent.addFlags(intent.FLAG_ACTIVITY_NEW_TASK);
|
|
145
|
-
context.startActivity(addIntent);
|
|
146
|
-
// context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse("https://play.google.com/store/apps/details?id=" + packageName)));
|
|
147
|
-
}
|
|
148
|
-
return true;
|
|
61
|
+
reactWebView.callInjectedJavaScript();
|
|
62
|
+
|
|
63
|
+
emitFinishEvent(webView, url);
|
|
64
|
+
}
|
|
149
65
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
66
|
+
|
|
67
|
+
@Override
|
|
68
|
+
public void doUpdateVisitedHistory (WebView webView, String url, boolean isReload) {
|
|
69
|
+
super.doUpdateVisitedHistory(webView, url, isReload);
|
|
70
|
+
|
|
71
|
+
((BPCWebView) webView).dispatchEvent(
|
|
72
|
+
webView,
|
|
73
|
+
new TopLoadingStartEvent(
|
|
74
|
+
webView.getId(),
|
|
75
|
+
createWebViewEvent(webView, url)));
|
|
160
76
|
}
|
|
161
|
-
return true;
|
|
162
|
-
}
|
|
163
|
-
/** bootpay added end ***/
|
|
164
|
-
|
|
165
|
-
protected boolean mLastLoadFailed = false;
|
|
166
|
-
protected @Nullable
|
|
167
|
-
ReadableArray mUrlPrefixesForDefaultIntent;
|
|
168
|
-
protected BPCWebView.ProgressChangedFilter progressChangedFilter = null;
|
|
169
|
-
protected @Nullable String ignoreErrFailedForThisURL = null;
|
|
170
|
-
protected @Nullable BasicAuthCredential basicAuthCredential = null;
|
|
171
|
-
|
|
172
|
-
public void setIgnoreErrFailedForThisURL(@Nullable String url) {
|
|
173
|
-
ignoreErrFailedForThisURL = url;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
public void setBasicAuthCredential(@Nullable BasicAuthCredential credential) {
|
|
177
|
-
basicAuthCredential = credential;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
@Override
|
|
181
|
-
public void onPageFinished(WebView webView, String url) {
|
|
182
|
-
super.onPageFinished(webView, url);
|
|
183
|
-
|
|
184
|
-
if (!mLastLoadFailed) {
|
|
185
|
-
BPCWebView reactWebView = (BPCWebView) webView;
|
|
186
77
|
|
|
187
|
-
|
|
78
|
+
@Override
|
|
79
|
+
public void onPageStarted(WebView webView, String url, Bitmap favicon) {
|
|
80
|
+
super.onPageStarted(webView, url, favicon);
|
|
81
|
+
mLastLoadFailed = false;
|
|
188
82
|
|
|
189
|
-
|
|
83
|
+
BPCWebView reactWebView = (BPCWebView) webView;
|
|
84
|
+
reactWebView.callInjectedJavaScriptBeforeContentLoaded();
|
|
190
85
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
BPCWebView reactWebView = (BPCWebView) webView;
|
|
199
|
-
reactWebView.callInjectedJavaScriptBeforeContentLoaded();
|
|
200
|
-
|
|
201
|
-
((BPCWebView) webView).dispatchEvent(
|
|
202
|
-
webView,
|
|
203
|
-
new TopLoadingStartEvent(
|
|
204
|
-
webView.getId(),
|
|
205
|
-
createWebViewEvent(webView, url)));
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
@Override
|
|
210
|
-
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
211
|
-
Intent intent = getIntentWithPackage(url);
|
|
212
|
-
Context context = view.getContext();
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
if(isIntent(url)) {
|
|
216
|
-
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
217
|
-
else return startGooglePlay(intent, context);
|
|
218
|
-
} else if(isMarket(url)) {
|
|
219
|
-
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
220
|
-
else return startGooglePlay(intent, context);
|
|
221
|
-
} else if(isSpecialCase(url)) {
|
|
222
|
-
if(isInstallApp(intent, context)) return startApp(intent, context);
|
|
223
|
-
else return startGooglePlay(intent, context);
|
|
86
|
+
|
|
87
|
+
@Override
|
|
88
|
+
public boolean shouldOverrideUrlLoading(WebView view, String url) {
|
|
89
|
+
if(BootpayUrlHelper.shouldOverrideUrlLoading(view, url)) {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
return shouldOverrideUrlLoadingRN(view, url);
|
|
224
93
|
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
return false;
|
|
94
|
+
|
|
95
|
+
public boolean shouldOverrideUrlLoadingRN(WebView view, String url) {
|
|
96
|
+
final BPCWebView BPCWebView = (BPCWebView) view;
|
|
97
|
+
final boolean isJsDebugging = ((ReactContext) view.getContext()).getJavaScriptContextHolder().get() == 0;
|
|
98
|
+
|
|
99
|
+
if (!isJsDebugging && BPCWebView.mCatalystInstance != null) {
|
|
100
|
+
final Pair<Double, AtomicReference<BPCWebViewModuleImpl.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState>> lock = BPCWebViewModuleImpl.shouldOverrideUrlLoadingLock.getNewLock();
|
|
101
|
+
final double lockIdentifier = lock.first;
|
|
102
|
+
final AtomicReference<BPCWebViewModuleImpl.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState> lockObject = lock.second;
|
|
103
|
+
|
|
104
|
+
final WritableMap event = createWebViewEvent(view, url);
|
|
105
|
+
event.putDouble("lockIdentifier", lockIdentifier);
|
|
106
|
+
BPCWebView.sendDirectMessage("onShouldStartLoadWithRequest", event);
|
|
107
|
+
|
|
108
|
+
try {
|
|
109
|
+
assert lockObject != null;
|
|
110
|
+
synchronized (lockObject) {
|
|
111
|
+
final long startTime = SystemClock.elapsedRealtime();
|
|
112
|
+
while (lockObject.get() == BPCWebViewModuleImpl.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState.UNDECIDED) {
|
|
113
|
+
if (SystemClock.elapsedRealtime() - startTime > SHOULD_OVERRIDE_URL_LOADING_TIMEOUT) {
|
|
114
|
+
FLog.w(TAG, "Did not receive response to shouldOverrideUrlLoading in time, defaulting to allow loading.");
|
|
115
|
+
BPCWebViewModuleImpl.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
lockObject.wait(SHOULD_OVERRIDE_URL_LOADING_TIMEOUT);
|
|
251
119
|
}
|
|
252
|
-
lockObject.wait(SHOULD_OVERRIDE_URL_LOADING_TIMEOUT);
|
|
253
120
|
}
|
|
121
|
+
} catch (InterruptedException e) {
|
|
122
|
+
FLog.e(TAG, "shouldOverrideUrlLoading was interrupted while waiting for result.", e);
|
|
123
|
+
BPCWebViewModuleImpl.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
|
|
124
|
+
return false;
|
|
254
125
|
}
|
|
255
|
-
} catch (InterruptedException e) {
|
|
256
|
-
FLog.e(TAG, "shouldOverrideUrlLoading was interrupted while waiting for result.", e);
|
|
257
|
-
BPCWebViewModule.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
|
|
258
|
-
return false;
|
|
259
|
-
}
|
|
260
126
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
view
|
|
270
|
-
new TopShouldStartLoadWithRequestEvent(
|
|
271
|
-
|
|
127
|
+
final boolean shouldOverride = lockObject.get() == BPCWebViewModuleImpl.ShouldOverrideUrlLoadingLock.ShouldOverrideCallbackState.SHOULD_OVERRIDE;
|
|
128
|
+
BPCWebViewModuleImpl.shouldOverrideUrlLoadingLock.removeLock(lockIdentifier);
|
|
129
|
+
|
|
130
|
+
return shouldOverride;
|
|
131
|
+
} else {
|
|
132
|
+
FLog.w(TAG, "Couldn't use blocking synchronous call for onShouldStartLoadWithRequest due to debugging or missing Catalyst instance, falling back to old event-and-load.");
|
|
133
|
+
progressChangedFilter.setWaitingForCommandLoadUrl(true);
|
|
134
|
+
|
|
135
|
+
int reactTag = view.getId();
|
|
136
|
+
UIManagerHelper.getEventDispatcherForReactTag((ReactContext) view.getContext(), reactTag).dispatchEvent(new TopShouldStartLoadWithRequestEvent(
|
|
137
|
+
reactTag,
|
|
272
138
|
createWebViewEvent(view, url)));
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
@TargetApi(Build.VERSION_CODES.N)
|
|
278
|
-
@Override
|
|
279
|
-
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
|
280
|
-
final String url = request.getUrl().toString();
|
|
281
|
-
return this.shouldOverrideUrlLoading(view, url);
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
@Override
|
|
285
|
-
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
|
|
286
|
-
if (basicAuthCredential != null) {
|
|
287
|
-
handler.proceed(basicAuthCredential.username, basicAuthCredential.password);
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
super.onReceivedHttpAuthRequest(view, handler, host, realm);
|
|
291
|
-
}
|
|
292
|
-
|
|
293
|
-
@Override
|
|
294
|
-
public void onReceivedSslError(final WebView webView, final SslErrorHandler handler, final SslError error) {
|
|
295
|
-
// onReceivedSslError is called for most requests, per Android docs: https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedSslError(android.webkit.WebView,%2520android.webkit.SslErrorHandler,%2520android.net.http.SslError)
|
|
296
|
-
// WebView.getUrl() will return the top-level window URL.
|
|
297
|
-
// If a top-level navigation triggers this error handler, the top-level URL will be the failing URL (not the URL of the currently-rendered page).
|
|
298
|
-
// This is desired behavior. We later use these values to determine whether the request is a top-level navigation or a subresource request.
|
|
299
|
-
String topWindowUrl = webView.getUrl();
|
|
300
|
-
String failingUrl = error.getUrl();
|
|
301
|
-
|
|
302
|
-
// Cancel request after obtaining top-level URL.
|
|
303
|
-
// If request is cancelled before obtaining top-level URL, undesired behavior may occur.
|
|
304
|
-
// Undesired behavior: Return value of WebView.getUrl() may be the current URL instead of the failing URL.
|
|
305
|
-
handler.cancel();
|
|
306
|
-
|
|
307
|
-
if (!topWindowUrl.equalsIgnoreCase(failingUrl)) {
|
|
308
|
-
// If error is not due to top-level navigation, then do not call onReceivedError()
|
|
309
|
-
Log.w(TAG, "Resource blocked from loading due to SSL error. Blocked URL: "+failingUrl);
|
|
310
|
-
return;
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
311
141
|
}
|
|
312
142
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
switch (code) {
|
|
319
|
-
case SslError.SSL_DATE_INVALID:
|
|
320
|
-
description = "The date of the certificate is invalid";
|
|
321
|
-
break;
|
|
322
|
-
case SslError.SSL_EXPIRED:
|
|
323
|
-
description = "The certificate has expired";
|
|
324
|
-
break;
|
|
325
|
-
case SslError.SSL_IDMISMATCH:
|
|
326
|
-
description = "Hostname mismatch";
|
|
327
|
-
break;
|
|
328
|
-
case SslError.SSL_INVALID:
|
|
329
|
-
description = "A generic error occurred";
|
|
330
|
-
break;
|
|
331
|
-
case SslError.SSL_NOTYETVALID:
|
|
332
|
-
description = "The certificate is not yet valid";
|
|
333
|
-
break;
|
|
334
|
-
case SslError.SSL_UNTRUSTED:
|
|
335
|
-
description = "The certificate authority is not trusted";
|
|
336
|
-
break;
|
|
337
|
-
default:
|
|
338
|
-
description = "Unknown SSL Error";
|
|
339
|
-
break;
|
|
143
|
+
@TargetApi(Build.VERSION_CODES.N)
|
|
144
|
+
@Override
|
|
145
|
+
public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
|
|
146
|
+
final String url = request.getUrl().toString();
|
|
147
|
+
return this.shouldOverrideUrlLoading(view, url);
|
|
340
148
|
}
|
|
341
149
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
@Override
|
|
353
|
-
public void onReceivedError(
|
|
354
|
-
WebView webView,
|
|
355
|
-
int errorCode,
|
|
356
|
-
String description,
|
|
357
|
-
String failingUrl) {
|
|
358
|
-
|
|
359
|
-
if (ignoreErrFailedForThisURL != null
|
|
360
|
-
&& failingUrl.equals(ignoreErrFailedForThisURL)
|
|
361
|
-
&& errorCode == -1
|
|
362
|
-
&& description.equals("net::ERR_FAILED")) {
|
|
363
|
-
|
|
364
|
-
// This is a workaround for a bug in the WebView.
|
|
365
|
-
// See these chromium issues for more context:
|
|
366
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=1023678
|
|
367
|
-
// https://bugs.chromium.org/p/chromium/issues/detail?id=1050635
|
|
368
|
-
// This entire commit should be reverted once this bug is resolved in chromium.
|
|
369
|
-
setIgnoreErrFailedForThisURL(null);
|
|
370
|
-
return;
|
|
150
|
+
@Override
|
|
151
|
+
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
|
|
152
|
+
if (basicAuthCredential != null) {
|
|
153
|
+
handler.proceed(basicAuthCredential.username, basicAuthCredential.password);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
super.onReceivedHttpAuthRequest(view, handler, host, realm);
|
|
371
157
|
}
|
|
372
158
|
|
|
373
|
-
|
|
374
|
-
|
|
159
|
+
@Override
|
|
160
|
+
public void onReceivedSslError(final WebView webView, final SslErrorHandler handler, final SslError error) {
|
|
161
|
+
// onReceivedSslError is called for most requests, per Android docs: https://developer.android.com/reference/android/webkit/WebViewClient#onReceivedSslError(android.webkit.WebView,%2520android.webkit.SslErrorHandler,%2520android.net.http.SslError)
|
|
162
|
+
// WebView.getUrl() will return the top-level window URL.
|
|
163
|
+
// If a top-level navigation triggers this error handler, the top-level URL will be the failing URL (not the URL of the currently-rendered page).
|
|
164
|
+
// This is desired behavior. We later use these values to determine whether the request is a top-level navigation or a subresource request.
|
|
165
|
+
String topWindowUrl = webView.getUrl();
|
|
166
|
+
String failingUrl = error.getUrl();
|
|
167
|
+
|
|
168
|
+
// Cancel request after obtaining top-level URL.
|
|
169
|
+
// If request is cancelled before obtaining top-level URL, undesired behavior may occur.
|
|
170
|
+
// Undesired behavior: Return value of WebView.getUrl() may be the current URL instead of the failing URL.
|
|
171
|
+
handler.cancel();
|
|
172
|
+
|
|
173
|
+
if (!topWindowUrl.equalsIgnoreCase(failingUrl)) {
|
|
174
|
+
// If error is not due to top-level navigation, then do not call onReceivedError()
|
|
175
|
+
Log.w(TAG, "Resource blocked from loading due to SSL error. Blocked URL: "+failingUrl);
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
int code = error.getPrimaryError();
|
|
180
|
+
String description = "";
|
|
181
|
+
String descriptionPrefix = "SSL error: ";
|
|
182
|
+
|
|
183
|
+
// https://developer.android.com/reference/android/net/http/SslError.html
|
|
184
|
+
switch (code) {
|
|
185
|
+
case SslError.SSL_DATE_INVALID:
|
|
186
|
+
description = "The date of the certificate is invalid";
|
|
187
|
+
break;
|
|
188
|
+
case SslError.SSL_EXPIRED:
|
|
189
|
+
description = "The certificate has expired";
|
|
190
|
+
break;
|
|
191
|
+
case SslError.SSL_IDMISMATCH:
|
|
192
|
+
description = "Hostname mismatch";
|
|
193
|
+
break;
|
|
194
|
+
case SslError.SSL_INVALID:
|
|
195
|
+
description = "A generic error occurred";
|
|
196
|
+
break;
|
|
197
|
+
case SslError.SSL_NOTYETVALID:
|
|
198
|
+
description = "The certificate is not yet valid";
|
|
199
|
+
break;
|
|
200
|
+
case SslError.SSL_UNTRUSTED:
|
|
201
|
+
description = "The certificate authority is not trusted";
|
|
202
|
+
break;
|
|
203
|
+
default:
|
|
204
|
+
description = "Unknown SSL Error";
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
description = descriptionPrefix + description;
|
|
375
209
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
210
|
+
this.onReceivedError(
|
|
211
|
+
webView,
|
|
212
|
+
code,
|
|
213
|
+
description,
|
|
214
|
+
failingUrl
|
|
215
|
+
);
|
|
216
|
+
}
|
|
379
217
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
218
|
+
@Override
|
|
219
|
+
public void onReceivedError(
|
|
220
|
+
WebView webView,
|
|
221
|
+
int errorCode,
|
|
222
|
+
String description,
|
|
223
|
+
String failingUrl) {
|
|
224
|
+
|
|
225
|
+
if (ignoreErrFailedForThisURL != null
|
|
226
|
+
&& failingUrl.equals(ignoreErrFailedForThisURL)
|
|
227
|
+
&& errorCode == -1
|
|
228
|
+
&& description.equals("net::ERR_FAILED")) {
|
|
229
|
+
|
|
230
|
+
// This is a workaround for a bug in the WebView.
|
|
231
|
+
// See these chromium issues for more context:
|
|
232
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=1023678
|
|
233
|
+
// https://bugs.chromium.org/p/chromium/issues/detail?id=1050635
|
|
234
|
+
// This entire commit should be reverted once this bug is resolved in chromium.
|
|
235
|
+
setIgnoreErrFailedForThisURL(null);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
383
238
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
new TopLoadingErrorEvent(webView.getId(), eventData));
|
|
387
|
-
}
|
|
239
|
+
super.onReceivedError(webView, errorCode, description, failingUrl);
|
|
240
|
+
mLastLoadFailed = true;
|
|
388
241
|
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
WebView webView,
|
|
393
|
-
WebResourceRequest request,
|
|
394
|
-
WebResourceResponse errorResponse) {
|
|
395
|
-
super.onReceivedHttpError(webView, request, errorResponse);
|
|
242
|
+
// In case of an error JS side expect to get a finish event first, and then get an error event
|
|
243
|
+
// Android WebView does it in the opposite way, so we need to simulate that behavior
|
|
244
|
+
emitFinishEvent(webView, failingUrl);
|
|
396
245
|
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
eventData.putString("description", errorResponse.getReasonPhrase());
|
|
246
|
+
WritableMap eventData = createWebViewEvent(webView, failingUrl);
|
|
247
|
+
eventData.putDouble("code", errorCode);
|
|
248
|
+
eventData.putString("description", description);
|
|
401
249
|
|
|
402
|
-
|
|
403
|
-
webView,
|
|
404
|
-
new TopHttpErrorEvent(webView.getId(), eventData));
|
|
250
|
+
int reactTag = webView.getId();
|
|
251
|
+
UIManagerHelper.getEventDispatcherForReactTag((ReactContext) webView.getContext(), reactTag).dispatchEvent(new TopLoadingErrorEvent(webView.getId(), eventData));
|
|
405
252
|
}
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
253
|
+
|
|
254
|
+
@RequiresApi(api = Build.VERSION_CODES.M)
|
|
255
|
+
@Override
|
|
256
|
+
public void onReceivedHttpError(
|
|
257
|
+
WebView webView,
|
|
258
|
+
WebResourceRequest request,
|
|
259
|
+
WebResourceResponse errorResponse) {
|
|
260
|
+
super.onReceivedHttpError(webView, request, errorResponse);
|
|
261
|
+
|
|
262
|
+
if (request.isForMainFrame()) {
|
|
263
|
+
WritableMap eventData = createWebViewEvent(webView, request.getUrl().toString());
|
|
264
|
+
eventData.putInt("statusCode", errorResponse.getStatusCode());
|
|
265
|
+
eventData.putString("description", errorResponse.getReasonPhrase());
|
|
266
|
+
|
|
267
|
+
int reactTag = webView.getId();
|
|
268
|
+
UIManagerHelper.getEventDispatcherForReactTag((ReactContext) webView.getContext(), reactTag).dispatchEvent(new TopHttpErrorEvent(webView.getId(), eventData));
|
|
269
|
+
}
|
|
414
270
|
}
|
|
415
|
-
super.onRenderProcessGone(webView, detail);
|
|
416
271
|
|
|
417
|
-
|
|
418
|
-
|
|
272
|
+
@TargetApi(Build.VERSION_CODES.O)
|
|
273
|
+
@Override
|
|
274
|
+
public boolean onRenderProcessGone(WebView webView, RenderProcessGoneDetail detail) {
|
|
275
|
+
// WebViewClient.onRenderProcessGone was added in O.
|
|
276
|
+
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
super.onRenderProcessGone(webView, detail);
|
|
280
|
+
|
|
281
|
+
if(detail.didCrash()){
|
|
282
|
+
Log.e(TAG, "The WebView rendering process crashed.");
|
|
283
|
+
}
|
|
284
|
+
else{
|
|
285
|
+
Log.w(TAG, "The WebView rendering process was killed by the system.");
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// if webView is null, we cannot return any event
|
|
289
|
+
// since the view is already dead/disposed
|
|
290
|
+
// still prevent the app crash by returning true.
|
|
291
|
+
if(webView == null){
|
|
292
|
+
return true;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
WritableMap event = createWebViewEvent(webView, webView.getUrl());
|
|
296
|
+
event.putBoolean("didCrash", detail.didCrash());
|
|
297
|
+
int reactTag = webView.getId();
|
|
298
|
+
UIManagerHelper.getEventDispatcherForReactTag((ReactContext) webView.getContext(), reactTag).dispatchEvent(new TopRenderProcessGoneEvent(webView.getId(), event));
|
|
299
|
+
|
|
300
|
+
// returning false would crash the app.
|
|
301
|
+
return true;
|
|
419
302
|
}
|
|
420
|
-
|
|
421
|
-
|
|
303
|
+
|
|
304
|
+
protected void emitFinishEvent(WebView webView, String url) {
|
|
305
|
+
int reactTag = webView.getId();
|
|
306
|
+
UIManagerHelper.getEventDispatcherForReactTag((ReactContext) webView.getContext(), reactTag).dispatchEvent(new TopLoadingFinishEvent(webView.getId(), createWebViewEvent(webView, url)));
|
|
422
307
|
}
|
|
423
308
|
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
309
|
+
protected WritableMap createWebViewEvent(WebView webView, String url) {
|
|
310
|
+
WritableMap event = Arguments.createMap();
|
|
311
|
+
event.putDouble("target", webView.getId());
|
|
312
|
+
// Don't use webView.getUrl() here, the URL isn't updated to the new value yet in callbacks
|
|
313
|
+
// like onPageFinished
|
|
314
|
+
event.putString("url", url);
|
|
315
|
+
event.putBoolean("loading", !mLastLoadFailed && webView.getProgress() != 100);
|
|
316
|
+
event.putString("title", webView.getTitle());
|
|
317
|
+
event.putBoolean("canGoBack", webView.canGoBack());
|
|
318
|
+
event.putBoolean("canGoForward", webView.canGoForward());
|
|
319
|
+
return event;
|
|
429
320
|
}
|
|
430
321
|
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
((BPCWebView) webView).dispatchEvent(
|
|
435
|
-
webView,
|
|
436
|
-
new TopRenderProcessGoneEvent(webView.getId(), event)
|
|
437
|
-
);
|
|
438
|
-
|
|
439
|
-
// returning false would crash the app.
|
|
440
|
-
return true;
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
protected void emitFinishEvent(WebView webView, String url) {
|
|
444
|
-
((BPCWebView) webView).dispatchEvent(
|
|
445
|
-
webView,
|
|
446
|
-
new TopLoadingFinishEvent(
|
|
447
|
-
webView.getId(),
|
|
448
|
-
createWebViewEvent(webView, url)));
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
protected WritableMap createWebViewEvent(WebView webView, String url) {
|
|
452
|
-
WritableMap event = Arguments.createMap();
|
|
453
|
-
event.putDouble("target", webView.getId());
|
|
454
|
-
// Don't use webView.getUrl() here, the URL isn't updated to the new value yet in callbacks
|
|
455
|
-
// like onPageFinished
|
|
456
|
-
event.putString("url", url);
|
|
457
|
-
event.putBoolean("loading", !mLastLoadFailed && webView.getProgress() != 100);
|
|
458
|
-
event.putString("title", webView.getTitle());
|
|
459
|
-
event.putBoolean("canGoBack", webView.canGoBack());
|
|
460
|
-
event.putBoolean("canGoForward", webView.canGoForward());
|
|
461
|
-
return event;
|
|
462
|
-
}
|
|
463
|
-
|
|
464
|
-
public void setUrlPrefixesForDefaultIntent(ReadableArray specialUrls) {
|
|
465
|
-
mUrlPrefixesForDefaultIntent = specialUrls;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
public void setProgressChangedFilter(BPCWebView.ProgressChangedFilter filter) {
|
|
469
|
-
progressChangedFilter = filter;
|
|
470
|
-
}
|
|
322
|
+
public void setProgressChangedFilter(BPCWebView.ProgressChangedFilter filter) {
|
|
323
|
+
progressChangedFilter = filter;
|
|
324
|
+
}
|
|
471
325
|
}
|