react-native-webview-bootpay 11.18.16 → 11.22.81
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/android/.gradle/6.8/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/6.8/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/6.8/fileChanges/last-build.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/6.8/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/6.8/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +2 -0
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/checksums/checksums.lock +0 -0
- package/android/.gradle/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/configuration-cache/gc.properties +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +6 -0
- package/android/.idea/gradle.xml +19 -0
- package/android/.idea/jarRepositories.xml +30 -0
- package/android/.idea/libraries/Gradle__androidx_annotation_annotation_1_1_0.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_appcompat_appcompat_1_0_2_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_common_2_0_0.xml +11 -0
- package/android/.idea/libraries/Gradle__androidx_arch_core_core_runtime_2_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_asynclayoutinflater_asynclayoutinflater_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_autofill_autofill_1_1_0_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_collection_collection_1_0_0.xml +11 -0
- package/android/.idea/libraries/Gradle__androidx_coordinatorlayout_coordinatorlayout_1_0_0_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_core_core_1_1_0_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_cursoradapter_cursoradapter_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_customview_customview_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_documentfile_documentfile_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_drawerlayout_drawerlayout_1_0_0_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_fragment_fragment_1_0_0_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_interpolator_interpolator_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_ui_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_legacy_legacy_support_core_utils_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_common_2_0_0.xml +11 -0
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_2_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_livedata_core_2_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_runtime_2_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_lifecycle_lifecycle_viewmodel_2_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_loader_loader_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_localbroadcastmanager_localbroadcastmanager_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_print_print_1_0_0_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_slidingpanelayout_slidingpanelayout_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_swiperefreshlayout_swiperefreshlayout_1_0_0_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_1_0_1_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_vectordrawable_vectordrawable_animated_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_versionedparcelable_versionedparcelable_1_1_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_viewpager_viewpager_1_0_0_aar.xml +13 -0
- package/android/.idea/libraries/Gradle__androidx_webkit_webkit_1_4_0_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__com_facebook_fbjni_fbjni_java_only_0_2_2.xml +13 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_drawee_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fbcore_2_5_0_aar.xml +18 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_fresco_2_5_0_aar.xml +18 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_2_5_0_aar.xml +18 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_base_2_5_0_aar.xml +18 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_native_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_imagepipeline_okhttp3_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_ashmem_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_java_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_memory_type_native_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagefilters_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_nativeimagetranscoder_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_fresco_ui_common_2_5_0_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_infer_annotation_infer_annotation_0_18_0.xml +13 -0
- package/android/.idea/libraries/Gradle__com_facebook_react_react_native_0_68_2_aar.xml +16 -0
- package/android/.idea/libraries/Gradle__com_facebook_soloader_annotation_0_10_3.xml +13 -0
- package/android/.idea/libraries/Gradle__com_facebook_soloader_nativeloader_0_10_3.xml +13 -0
- package/android/.idea/libraries/Gradle__com_facebook_soloader_soloader_0_10_3_aar.xml +15 -0
- package/android/.idea/libraries/Gradle__com_facebook_yoga_proguard_annotations_1_19_0.xml +13 -0
- package/android/.idea/libraries/Gradle__com_google_code_findbugs_jsr305_3_0_2.xml +13 -0
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_4_9_2.xml +13 -0
- package/android/.idea/libraries/Gradle__com_squareup_okhttp3_okhttp_urlconnection_4_9_2.xml +13 -0
- package/android/.idea/libraries/Gradle__com_squareup_okio_okio_2_9_0.xml +13 -0
- package/android/.idea/libraries/Gradle__javax_inject_javax_inject_1.xml +13 -0
- package/android/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml +13 -0
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_annotations_jvm_1_3_72.xml +13 -0
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_4_10.xml +13 -0
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_common_1_4_10.xml +13 -0
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk7_1_4_10.xml +13 -0
- package/android/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_jdk8_1_4_10.xml +13 -0
- package/android/.idea/misc.xml +9 -0
- package/android/.idea/modules/android.iml +133 -0
- package/android/.idea/modules.xml +8 -0
- package/android/.idea/vcs.xml +6 -0
- package/android/build/.transforms/28ceacf58c1f53104331b6d3900dca4f/results.bin +1 -0
- package/android/build/.transforms/28ceacf58c1f53104331b6d3900dca4f/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/51cb61441c00f43d07400187762c0edf/results.bin +1 -0
- package/android/build/.transforms/51cb61441c00f43d07400187762c0edf/transformed/classes/classes.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/results.bin +1 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient$1.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebChromeClient.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebView$1.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebView$BPCWebViewBridge.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebView$ProgressChangedFilter.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebView.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewClient.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewFileProvider.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$1.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$2.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$3.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager$4.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewManager.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$1.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$2.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$MimeType.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule$ShouldOverrideUrlLoadingLock.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewModule.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BPCWebViewPackage.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BasicAuthCredential.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/BuildConfig.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/WebViewConfig.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent$Companion.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopHttpErrorEvent.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent$Companion.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopLoadingErrorEvent.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent$Companion.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopLoadingFinishEvent.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent$Companion.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopLoadingProgressEvent.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent$Companion.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopLoadingStartEvent.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent$Companion.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopMessageEvent.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent$Companion.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopRenderProcessGoneEvent.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent$Companion.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/debug/kr/co/bootpay/webview/events/TopShouldStartLoadWithRequestEvent.dex +0 -0
- package/android/build/.transforms/c0e3d8f6408bfb0237947517dbd71608/transformed/desugar_graph.bin +0 -0
- package/android/build/.transforms/fb29541d9d3f14fd2af0228851f54ad5/results.bin +1 -0
- package/android/build/generated/source/buildConfig/debug/kr/co/bootpay/webview/BuildConfig.java +10 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +106 -0
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +18 -0
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +4 -0
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +1 -0
- 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 +1861 -0
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +2 -0
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +2 -0
- package/android/build/intermediates/incremental/packageDebugResources/compile-file-map.properties +2 -0
- package/android/build/intermediates/incremental/packageDebugResources/merger.xml +2 -0
- 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/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 +3 -0
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +210 -0
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +106 -0
- package/android/build/intermediates/navigation_json/debug/navigation.json +1 -0
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +18 -0
- package/android/build/intermediates/packaged_res/debug/xml/file_provider_paths.xml +6 -0
- package/android/build/intermediates/runtime_library_classes_dir/debug/META-INF/react-native-webview_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/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 +1381 -0
- 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/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 +2 -0
- 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 +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/localstate/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +229 -0
- package/android/build/tmp/compileDebugJavaWithJavac/previous-compilation-data.bin +0 -0
- package/android/build/tmp/kotlin-classes/debug/META-INF/react-native-webview_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/build.gradle +6 -6
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +6 -6
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/local.properties +8 -0
- package/android/src/main/AndroidManifest.xml +67 -62
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +25 -17
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +31 -14
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +142 -117
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManager.java +144 -89
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModule.java +27 -21
- package/android/src/main/java/kr/co/bootpay/webview/BasicAuthCredential.java +11 -0
- package/apple/BPCWKProcessPoolManager.m +11 -11
- package/apple/BPCWebView.h +22 -1
- package/apple/BPCWebView.m +700 -646
- package/apple/BPCWebViewManager.h +2 -0
- package/apple/BPCWebViewManager.m +45 -8
- package/index.d.ts +5 -5
- package/ios/BPCWebView.xcodeproj/project.pbxproj +310 -0
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/BPCWebView.xcodeproj/project.xcworkspace/xcuserdata/ehowlsla.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/BPCWebView.xcodeproj/xcuserdata/ehowlsla.xcuserdatad/xcschemes/xcschememanagement.plist +29 -0
- package/lib/WebView.android.d.ts +4 -75
- package/lib/WebView.android.d.ts.map +1 -1
- package/lib/WebView.android.js +88 -270
- package/lib/WebView.d.ts +2 -2
- package/lib/WebView.d.ts.map +1 -1
- package/lib/WebView.ios.d.ts +4 -80
- package/lib/WebView.ios.d.ts.map +1 -1
- package/lib/WebView.ios.js +86 -223
- package/lib/WebView.js +7 -9
- package/lib/WebView.macos.d.ts +4 -80
- package/lib/WebView.macos.d.ts.map +1 -1
- package/lib/WebView.macos.js +83 -221
- package/lib/WebView.windows.d.ts +5 -27
- package/lib/WebView.windows.d.ts.map +1 -1
- package/lib/WebView.windows.js +114 -165
- package/lib/WebViewNativeComponent.android.d.ts +4 -0
- package/lib/WebViewNativeComponent.android.d.ts.map +1 -0
- package/lib/WebViewNativeComponent.android.js +3 -0
- package/lib/WebViewNativeComponent.ios.d.ts +4 -0
- package/lib/WebViewNativeComponent.ios.d.ts.map +1 -0
- package/lib/WebViewNativeComponent.ios.js +3 -0
- package/lib/WebViewNativeComponent.macos.d.ts +4 -0
- package/lib/WebViewNativeComponent.macos.d.ts.map +1 -0
- package/lib/WebViewNativeComponent.macos.js +3 -0
- package/lib/WebViewNativeComponent.windows.d.ts +4 -0
- package/lib/WebViewNativeComponent.windows.d.ts.map +1 -0
- package/lib/WebViewNativeComponent.windows.js +3 -0
- package/lib/WebViewShared.d.ts +33 -3
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewShared.js +85 -2
- package/lib/WebViewTypes.d.ts +154 -14
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/lib/index.d.ts +4 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +3 -0
- package/package.json +19 -21
- package/react-native-webview-bootpay.podspec +1 -2
- package/react-native.config.js +47 -61
- package/windows/ExperimentalFeatures.props +11 -0
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +48 -23
- package/windows/ReactNativeWebView/ReactPackageProvider.cpp +6 -1
- package/windows/ReactNativeWebView/ReactWebView.cpp +17 -16
- package/windows/ReactNativeWebView/ReactWebView.h +5 -3
- package/windows/ReactNativeWebView/ReactWebView.idl +17 -3
- package/windows/ReactNativeWebView/ReactWebView2.cpp +185 -0
- package/windows/ReactNativeWebView/ReactWebView2.h +51 -0
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +155 -0
- package/windows/ReactNativeWebView/ReactWebView2Manager.h +57 -0
- package/windows/ReactNativeWebView/ReactWebViewManager.cpp +37 -32
- package/windows/{WebViewBridgeComponent → ReactNativeWebView}/WebBridge.cpp +1 -1
- package/windows/{WebViewBridgeComponent → ReactNativeWebView}/WebBridge.h +2 -2
- package/windows/{WebViewBridgeComponent → ReactNativeWebView}/WebBridge.idl +1 -1
- package/windows/ReactNativeWebView/packages.config +1 -0
- package/windows/ReactNativeWebView/pch.h +17 -0
- package/windows/ReactNativeWebView.sln +80 -119
- package/ios/RNCWebView.xcodeproj/project.pbxproj +0 -271
- package/windows/WebViewBridgeComponent/PropertySheet.props +0 -16
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.def +0 -3
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj +0 -160
- package/windows/WebViewBridgeComponent/WebViewBridgeComponent.vcxproj.filters +0 -33
- package/windows/WebViewBridgeComponent/packages.config +0 -4
- package/windows/WebViewBridgeComponent/pch.cpp +0 -1
- package/windows/WebViewBridgeComponent/pch.h +0 -4
- package/windows/WebViewBridgeComponent/readme.txt +0 -23
package/apple/BPCWebView.m
CHANGED
|
@@ -18,30 +18,32 @@
|
|
|
18
18
|
#import "objc/runtime.h"
|
|
19
19
|
|
|
20
20
|
static NSTimer *keyboardTimer;
|
|
21
|
-
static NSString *const HistoryShimName = @"
|
|
22
|
-
static NSString *const MessageHandlerName = @"
|
|
21
|
+
static NSString *const HistoryShimName = @"ReactNativeHistoryShim";
|
|
22
|
+
static NSString *const MessageHandlerName = @"ReactNativeWebView";
|
|
23
23
|
static NSURLCredential* clientAuthenticationCredential;
|
|
24
24
|
static NSDictionary* customCertificatesForHost;
|
|
25
25
|
|
|
26
|
+
NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
27
|
+
|
|
26
28
|
#if !TARGET_OS_OSX
|
|
27
29
|
// runtime trick to remove WKWebView keyboard default toolbar
|
|
28
30
|
// see: http://stackoverflow.com/questions/19033292/ios-7-uiwebview-keyboard-issue/19042279#19042279
|
|
29
|
-
@interface
|
|
31
|
+
@interface _SwizzleHelperWK : UIView
|
|
30
32
|
@property (nonatomic, copy) WKWebView *webView;
|
|
31
33
|
@end
|
|
32
|
-
@implementation
|
|
34
|
+
@implementation _SwizzleHelperWK
|
|
33
35
|
-(id)inputAccessoryView
|
|
34
36
|
{
|
|
35
|
-
|
|
36
|
-
return nil;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if ([_webView respondsToSelector:@selector(inputAssistantItem)]) {
|
|
40
|
-
UITextInputAssistantItem *inputAssistantItem = [_webView inputAssistantItem];
|
|
41
|
-
inputAssistantItem.leadingBarButtonGroups = @[];
|
|
42
|
-
inputAssistantItem.trailingBarButtonGroups = @[];
|
|
43
|
-
}
|
|
37
|
+
if (_webView == nil) {
|
|
44
38
|
return nil;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if ([_webView respondsToSelector:@selector(inputAssistantItem)]) {
|
|
42
|
+
UITextInputAssistantItem *inputAssistantItem = [_webView inputAssistantItem];
|
|
43
|
+
inputAssistantItem.leadingBarButtonGroups = @[];
|
|
44
|
+
inputAssistantItem.trailingBarButtonGroups = @[];
|
|
45
|
+
}
|
|
46
|
+
return nil;
|
|
45
47
|
}
|
|
46
48
|
@end
|
|
47
49
|
#endif // !TARGET_OS_OSX
|
|
@@ -51,9 +53,9 @@ static NSDictionary* customCertificatesForHost;
|
|
|
51
53
|
@end
|
|
52
54
|
@implementation BPCWKWebView
|
|
53
55
|
- (void)scrollWheel:(NSEvent *)theEvent {
|
|
54
|
-
BPCWebView *
|
|
55
|
-
RCTAssert([
|
|
56
|
-
if (![
|
|
56
|
+
BPCWebView *rncWebView = (BPCWebView *)[self superview];
|
|
57
|
+
RCTAssert([rncWebView isKindOfClass:[rncWebView class]], @"superview must be an BPCWebView");
|
|
58
|
+
if (![rncWebView scrollEnabled]) {
|
|
57
59
|
[[self nextResponder] scrollWheel:theEvent];
|
|
58
60
|
return;
|
|
59
61
|
}
|
|
@@ -64,9 +66,9 @@ static NSDictionary* customCertificatesForHost;
|
|
|
64
66
|
|
|
65
67
|
@interface BPCWebView () <WKUIDelegate, WKNavigationDelegate, WKScriptMessageHandler,
|
|
66
68
|
#if !TARGET_OS_OSX
|
|
67
|
-
|
|
69
|
+
UIScrollViewDelegate,
|
|
68
70
|
#endif // !TARGET_OS_OSX
|
|
69
|
-
|
|
71
|
+
RCTAutoInsetsProtocol>
|
|
70
72
|
|
|
71
73
|
@property (nonatomic, copy) RCTDirectEventBlock onFileDownload;
|
|
72
74
|
@property (nonatomic, copy) RCTDirectEventBlock onLoadingStart;
|
|
@@ -97,7 +99,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
97
99
|
#endif // !TARGET_OS_OSX
|
|
98
100
|
BOOL _savedHideKeyboardAccessoryView;
|
|
99
101
|
BOOL _savedKeyboardDisplayRequiresUserAction;
|
|
100
|
-
|
|
102
|
+
|
|
101
103
|
// Workaround for StatusBar appearance bug for iOS 12
|
|
102
104
|
// https://github.com/react-native-webview/react-native-webview/issues/62
|
|
103
105
|
BOOL _isFullScreenVideoOpen;
|
|
@@ -105,7 +107,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
105
107
|
UIStatusBarStyle _savedStatusBarStyle;
|
|
106
108
|
#endif // !TARGET_OS_OSX
|
|
107
109
|
BOOL _savedStatusBarHidden;
|
|
108
|
-
|
|
110
|
+
|
|
109
111
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
|
110
112
|
UIScrollViewContentInsetAdjustmentBehavior _savedContentInsetAdjustmentBehavior;
|
|
111
113
|
#endif
|
|
@@ -117,11 +119,11 @@ static NSDictionary* customCertificatesForHost;
|
|
|
117
119
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
118
120
|
{
|
|
119
121
|
if ((self = [super initWithFrame:frame])) {
|
|
120
|
-
|
|
122
|
+
#if !TARGET_OS_OSX
|
|
121
123
|
super.backgroundColor = [UIColor clearColor];
|
|
122
|
-
|
|
124
|
+
#else
|
|
123
125
|
super.backgroundColor = [RCTUIColor clearColor];
|
|
124
|
-
|
|
126
|
+
#endif // !TARGET_OS_OSX
|
|
125
127
|
_bounces = YES;
|
|
126
128
|
_scrollEnabled = YES;
|
|
127
129
|
_showsHorizontalScrollIndicator = YES;
|
|
@@ -131,15 +133,15 @@ static NSDictionary* customCertificatesForHost;
|
|
|
131
133
|
_autoManageStatusBarEnabled = YES;
|
|
132
134
|
_contentInset = UIEdgeInsetsZero;
|
|
133
135
|
_savedKeyboardDisplayRequiresUserAction = YES;
|
|
134
|
-
|
|
136
|
+
#if !TARGET_OS_OSX
|
|
135
137
|
_savedStatusBarStyle = RCTSharedApplication().statusBarStyle;
|
|
136
138
|
_savedStatusBarHidden = RCTSharedApplication().statusBarHidden;
|
|
137
|
-
|
|
139
|
+
#endif // !TARGET_OS_OSX
|
|
138
140
|
_injectedJavaScript = nil;
|
|
139
141
|
_injectedJavaScriptForMainFrameOnly = YES;
|
|
140
142
|
_injectedJavaScriptBeforeContentLoaded = nil;
|
|
141
143
|
_injectedJavaScriptBeforeContentLoadedForMainFrameOnly = YES;
|
|
142
|
-
|
|
144
|
+
|
|
143
145
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
|
144
146
|
_savedContentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
145
147
|
#endif
|
|
@@ -147,86 +149,170 @@ static NSDictionary* customCertificatesForHost;
|
|
|
147
149
|
_savedAutomaticallyAdjustsScrollIndicatorInsets = NO;
|
|
148
150
|
#endif
|
|
149
151
|
_enableApplePay = NO;
|
|
152
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */
|
|
153
|
+
_mediaCapturePermissionGrantType = BPCWebViewPermissionGrantType_Prompt;
|
|
154
|
+
#endif
|
|
150
155
|
}
|
|
151
|
-
|
|
156
|
+
|
|
152
157
|
#if !TARGET_OS_OSX
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
158
|
+
[[NSNotificationCenter defaultCenter]addObserver:self
|
|
159
|
+
selector:@selector(appDidBecomeActive)
|
|
160
|
+
name:UIApplicationDidBecomeActiveNotification
|
|
161
|
+
object:nil];
|
|
162
|
+
|
|
163
|
+
[[NSNotificationCenter defaultCenter]addObserver:self
|
|
164
|
+
selector:@selector(appWillResignActive)
|
|
165
|
+
name:UIApplicationWillResignActiveNotification
|
|
166
|
+
object:nil];
|
|
162
167
|
if (@available(iOS 12.0, *)) {
|
|
163
168
|
// Workaround for a keyboard dismissal bug present in iOS 12
|
|
164
169
|
// https://openradar.appspot.com/radar?id=5018321736957952
|
|
165
170
|
[[NSNotificationCenter defaultCenter]
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
171
|
+
addObserver:self
|
|
172
|
+
selector:@selector(keyboardWillHide)
|
|
173
|
+
name:UIKeyboardWillHideNotification object:nil];
|
|
169
174
|
[[NSNotificationCenter defaultCenter]
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
175
|
+
addObserver:self
|
|
176
|
+
selector:@selector(keyboardWillShow)
|
|
177
|
+
name:UIKeyboardWillShowNotification object:nil];
|
|
178
|
+
|
|
174
179
|
// Workaround for StatusBar appearance bug for iOS 12
|
|
175
180
|
// https://github.com/react-native-webview/react-native-webview/issues/62
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
181
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
182
|
+
selector:@selector(showFullScreenVideoStatusBars)
|
|
183
|
+
name:UIWindowDidBecomeVisibleNotification
|
|
184
|
+
object:nil];
|
|
185
|
+
|
|
186
|
+
[[NSNotificationCenter defaultCenter] addObserver:self
|
|
187
|
+
selector:@selector(hideFullScreenVideoStatusBars)
|
|
188
|
+
name:UIWindowDidBecomeHiddenNotification
|
|
189
|
+
object:nil];
|
|
190
|
+
|
|
186
191
|
}
|
|
187
192
|
#endif // !TARGET_OS_OSX
|
|
188
193
|
return self;
|
|
189
194
|
}
|
|
190
195
|
|
|
196
|
+
#if !TARGET_OS_OSX
|
|
197
|
+
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
|
|
198
|
+
// Only allow long press gesture
|
|
199
|
+
if ([otherGestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]]) {
|
|
200
|
+
return YES;
|
|
201
|
+
}else{
|
|
202
|
+
return NO;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Listener for long presses
|
|
207
|
+
- (void)startLongPress:(UILongPressGestureRecognizer *)pressSender
|
|
208
|
+
{
|
|
209
|
+
// When a long press ends, bring up our custom UIMenu
|
|
210
|
+
if(pressSender.state == UIGestureRecognizerStateEnded) {
|
|
211
|
+
if (!self.menuItems || self.menuItems.count == 0) {
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
UIMenuController *menuController = [UIMenuController sharedMenuController];
|
|
215
|
+
NSMutableArray *menuControllerItems = [NSMutableArray arrayWithCapacity:self.menuItems.count];
|
|
216
|
+
|
|
217
|
+
for(NSDictionary *menuItem in self.menuItems) {
|
|
218
|
+
NSString *menuItemLabel = [RCTConvert NSString:menuItem[@"label"]];
|
|
219
|
+
NSString *menuItemKey = [RCTConvert NSString:menuItem[@"key"]];
|
|
220
|
+
NSString *sel = [NSString stringWithFormat:@"%@%@", CUSTOM_SELECTOR, menuItemKey];
|
|
221
|
+
UIMenuItem *item = [[UIMenuItem alloc] initWithTitle: menuItemLabel
|
|
222
|
+
action: NSSelectorFromString(sel)];
|
|
223
|
+
|
|
224
|
+
[menuControllerItems addObject: item];
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
menuController.menuItems = menuControllerItems;
|
|
228
|
+
[menuController setMenuVisible:YES animated:YES];
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
#endif // !TARGET_OS_OSX
|
|
233
|
+
|
|
191
234
|
- (void)dealloc
|
|
192
235
|
{
|
|
193
236
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
194
237
|
}
|
|
195
238
|
|
|
196
|
-
|
|
197
|
-
* See https://stackoverflow.com/questions/25713069/why-is-wkwebview-not-opening-links-with-target-blank/25853806#25853806 for details.
|
|
198
|
-
*/
|
|
199
|
-
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
|
|
239
|
+
- (void)tappedMenuItem:(NSString *)eventType
|
|
200
240
|
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
if(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
//원래 로직
|
|
208
|
-
if (!navigationAction.targetFrame.isMainFrame) {
|
|
209
|
-
[webView loadRequest:navigationAction.request];
|
|
210
|
-
}
|
|
211
|
-
return nil;
|
|
241
|
+
// Get the selected text
|
|
242
|
+
// NOTE: selecting text in an iframe or shadow DOM will not work
|
|
243
|
+
[self.webView evaluateJavaScript: @"window.getSelection().toString()" completionHandler: ^(id result, NSError *error) {
|
|
244
|
+
if (error != nil) {
|
|
245
|
+
RCTLogWarn(@"%@", [NSString stringWithFormat:@"Error evaluating injectedJavaScript: This is possibly due to an unsupported return type. Try adding true to the end of your injectedJavaScript string. %@", error]);
|
|
212
246
|
} else {
|
|
247
|
+
if (self.onCustomMenuSelection) {
|
|
248
|
+
NSPredicate *filter = [NSPredicate predicateWithFormat:@"key contains[c] %@ ",eventType];
|
|
249
|
+
NSArray *filteredMenuItems = [self.menuItems filteredArrayUsingPredicate:filter];
|
|
250
|
+
NSDictionary *selectedMenuItem = filteredMenuItems[0];
|
|
251
|
+
NSString *label = [RCTConvert NSString:selectedMenuItem[@"label"]];
|
|
252
|
+
self.onCustomMenuSelection(@{
|
|
253
|
+
@"key": eventType,
|
|
254
|
+
@"label": label,
|
|
255
|
+
@"selectedText": result
|
|
256
|
+
});
|
|
257
|
+
} else {
|
|
258
|
+
RCTLogWarn(@"Error evaluating onCustomMenuSelection: You must implement an `onCustomMenuSelection` callback when using custom menu items");
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}];
|
|
262
|
+
}
|
|
213
263
|
|
|
214
|
-
|
|
264
|
+
// Overwrite method that interprets which action to call upon UIMenu Selection
|
|
265
|
+
// https://developer.apple.com/documentation/objectivec/nsobject/1571960-methodsignatureforselector
|
|
266
|
+
- (NSMethodSignature *)methodSignatureForSelector:(SEL)sel
|
|
267
|
+
{
|
|
268
|
+
NSMethodSignature *existingSelector = [super methodSignatureForSelector:sel];
|
|
269
|
+
if (existingSelector) {
|
|
270
|
+
return existingSelector;
|
|
271
|
+
}
|
|
272
|
+
return [super methodSignatureForSelector:@selector(tappedMenuItem:)];
|
|
273
|
+
}
|
|
215
274
|
|
|
216
|
-
|
|
275
|
+
// Needed to forward messages to other objects
|
|
276
|
+
// https://developer.apple.com/documentation/objectivec/nsobject/1571955-forwardinvocation
|
|
277
|
+
- (void)forwardInvocation:(NSInvocation *)invocation
|
|
278
|
+
{
|
|
279
|
+
NSString *sel = NSStringFromSelector([invocation selector]);
|
|
280
|
+
NSRange match = [sel rangeOfString:CUSTOM_SELECTOR];
|
|
281
|
+
if (match.location == 0) {
|
|
282
|
+
[self tappedMenuItem:[sel substringFromIndex:17]];
|
|
283
|
+
} else {
|
|
284
|
+
[super forwardInvocation:invocation];
|
|
285
|
+
}
|
|
286
|
+
}
|
|
217
287
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
return popupView;
|
|
224
|
-
}
|
|
288
|
+
// Allows the instance to respond to UIMenuController Actions
|
|
289
|
+
- (BOOL)canBecomeFirstResponder
|
|
290
|
+
{
|
|
291
|
+
return YES;
|
|
225
292
|
}
|
|
226
293
|
|
|
294
|
+
// Control which items show up on the UIMenuController
|
|
295
|
+
- (BOOL)canPerformAction:(SEL)action withSender:(id)sender
|
|
296
|
+
{
|
|
297
|
+
NSString *sel = NSStringFromSelector(action);
|
|
298
|
+
// Do any of them have our custom keys?
|
|
299
|
+
NSRange match = [sel rangeOfString:CUSTOM_SELECTOR];
|
|
300
|
+
|
|
301
|
+
if (match.location == 0) {
|
|
302
|
+
return YES;
|
|
303
|
+
}
|
|
304
|
+
return NO;
|
|
305
|
+
}
|
|
227
306
|
|
|
228
|
-
|
|
229
|
-
|
|
307
|
+
/**
|
|
308
|
+
* See https://stackoverflow.com/questions/25713069/why-is-wkwebview-not-opening-links-with-target-blank/25853806#25853806 for details.
|
|
309
|
+
*/
|
|
310
|
+
- (WKWebView *)webView:(WKWebView *)webView createWebViewWithConfiguration:(WKWebViewConfiguration *)configuration forNavigationAction:(WKNavigationAction *)navigationAction windowFeatures:(WKWindowFeatures *)windowFeatures
|
|
311
|
+
{
|
|
312
|
+
if (!navigationAction.targetFrame.isMainFrame) {
|
|
313
|
+
[webView loadRequest:navigationAction.request];
|
|
314
|
+
}
|
|
315
|
+
return nil;
|
|
230
316
|
}
|
|
231
317
|
|
|
232
318
|
- (WKWebViewConfiguration *)setUpWkWebViewConfig
|
|
@@ -249,6 +335,14 @@ static NSDictionary* customCertificatesForHost;
|
|
|
249
335
|
[prefs setValue:@TRUE forKey:@"javaScriptCanOpenWindowsAutomatically"];
|
|
250
336
|
_prefsUsed = YES;
|
|
251
337
|
}
|
|
338
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500 /* iOS 14.5 */
|
|
339
|
+
if (@available(iOS 14.5, *)) {
|
|
340
|
+
if (!_textInteractionEnabled) {
|
|
341
|
+
[prefs setValue:@FALSE forKey:@"textInteractionEnabled"];
|
|
342
|
+
_prefsUsed = YES;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
#endif
|
|
252
346
|
if (_prefsUsed) {
|
|
253
347
|
wkWebViewConfig.preferences = prefs;
|
|
254
348
|
}
|
|
@@ -261,7 +355,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
261
355
|
wkWebViewConfig.processPool = [[BPCWKProcessPoolManager sharedManager] sharedProcessPool];
|
|
262
356
|
}
|
|
263
357
|
wkWebViewConfig.userContentController = [WKUserContentController new];
|
|
264
|
-
|
|
358
|
+
|
|
265
359
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* iOS 13 */
|
|
266
360
|
if (@available(iOS 13.0, *)) {
|
|
267
361
|
WKWebpagePreferences *pagePrefs = [[WKWebpagePreferences alloc]init];
|
|
@@ -269,7 +363,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
269
363
|
wkWebViewConfig.defaultWebpagePreferences = pagePrefs;
|
|
270
364
|
}
|
|
271
365
|
#endif
|
|
272
|
-
|
|
366
|
+
|
|
273
367
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 /* iOS 14 */
|
|
274
368
|
if (@available(iOS 14.0, *)) {
|
|
275
369
|
if ([wkWebViewConfig respondsToSelector:@selector(limitsNavigationsToAppBoundDomains)]) {
|
|
@@ -279,28 +373,32 @@ static NSDictionary* customCertificatesForHost;
|
|
|
279
373
|
}
|
|
280
374
|
}
|
|
281
375
|
#endif
|
|
282
|
-
|
|
376
|
+
|
|
283
377
|
// Shim the HTML5 history API:
|
|
284
378
|
[wkWebViewConfig.userContentController addScriptMessageHandler:[[BPCWeakScriptMessageDelegate alloc] initWithDelegate:self]
|
|
285
379
|
name:HistoryShimName];
|
|
286
380
|
[self resetupScripts:wkWebViewConfig];
|
|
287
|
-
|
|
381
|
+
|
|
382
|
+
if(@available(macos 10.11, ios 9.0, *)) {
|
|
383
|
+
wkWebViewConfig.allowsAirPlayForMediaPlayback = _allowsAirPlayForMediaPlayback;
|
|
384
|
+
}
|
|
385
|
+
|
|
288
386
|
#if !TARGET_OS_OSX
|
|
289
387
|
wkWebViewConfig.allowsInlineMediaPlayback = _allowsInlineMediaPlayback;
|
|
290
388
|
#if WEBKIT_IOS_10_APIS_AVAILABLE
|
|
291
389
|
wkWebViewConfig.mediaTypesRequiringUserActionForPlayback = _mediaPlaybackRequiresUserAction
|
|
292
|
-
|
|
293
|
-
|
|
390
|
+
? WKAudiovisualMediaTypeAll
|
|
391
|
+
: WKAudiovisualMediaTypeNone;
|
|
294
392
|
wkWebViewConfig.dataDetectorTypes = _dataDetectorTypes;
|
|
295
393
|
#else
|
|
296
394
|
wkWebViewConfig.mediaPlaybackRequiresUserAction = _mediaPlaybackRequiresUserAction;
|
|
297
395
|
#endif
|
|
298
396
|
#endif // !TARGET_OS_OSX
|
|
299
|
-
|
|
397
|
+
|
|
300
398
|
if (_applicationNameForUserAgent) {
|
|
301
|
-
|
|
399
|
+
wkWebViewConfig.applicationNameForUserAgent = [NSString stringWithFormat:@"%@ %@", wkWebViewConfig.applicationNameForUserAgent, _applicationNameForUserAgent];
|
|
302
400
|
}
|
|
303
|
-
|
|
401
|
+
|
|
304
402
|
return wkWebViewConfig;
|
|
305
403
|
}
|
|
306
404
|
|
|
@@ -313,7 +411,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
313
411
|
#else
|
|
314
412
|
_webView = [[BPCWKWebView alloc] initWithFrame:self.bounds configuration: wkWebViewConfig];
|
|
315
413
|
#endif // !TARGET_OS_OSX
|
|
316
|
-
|
|
414
|
+
|
|
317
415
|
[self setBackgroundColor: _savedBackgroundColor];
|
|
318
416
|
#if !TARGET_OS_OSX
|
|
319
417
|
_webView.scrollView.delegate = self;
|
|
@@ -322,11 +420,11 @@ static NSDictionary* customCertificatesForHost;
|
|
|
322
420
|
_webView.navigationDelegate = self;
|
|
323
421
|
#if !TARGET_OS_OSX
|
|
324
422
|
if (_pullToRefreshEnabled) {
|
|
325
|
-
|
|
423
|
+
[self addPullToRefreshControl];
|
|
326
424
|
}
|
|
327
425
|
_webView.scrollView.scrollEnabled = _scrollEnabled;
|
|
328
426
|
_webView.scrollView.pagingEnabled = _pagingEnabled;
|
|
329
|
-
|
|
427
|
+
//For UIRefreshControl to work correctly, the bounces should always be true
|
|
330
428
|
_webView.scrollView.bounces = _pullToRefreshEnabled || _bounces;
|
|
331
429
|
_webView.scrollView.showsHorizontalScrollIndicator = _showsHorizontalScrollIndicator;
|
|
332
430
|
_webView.scrollView.showsVerticalScrollIndicator = _showsVerticalScrollIndicator;
|
|
@@ -335,10 +433,8 @@ static NSDictionary* customCertificatesForHost;
|
|
|
335
433
|
_webView.allowsLinkPreview = _allowsLinkPreview;
|
|
336
434
|
[_webView addObserver:self forKeyPath:@"estimatedProgress" options:NSKeyValueObservingOptionOld | NSKeyValueObservingOptionNew context:nil];
|
|
337
435
|
_webView.allowsBackForwardNavigationGestures = _allowsBackForwardNavigationGestures;
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
_webView.customUserAgent = _userAgent;
|
|
341
|
-
}
|
|
436
|
+
|
|
437
|
+
_webView.customUserAgent = _userAgent;
|
|
342
438
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
|
343
439
|
if ([_webView.scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
|
|
344
440
|
_webView.scrollView.contentInsetAdjustmentBehavior = _savedContentInsetAdjustmentBehavior;
|
|
@@ -349,12 +445,24 @@ static NSDictionary* customCertificatesForHost;
|
|
|
349
445
|
_webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = _savedAutomaticallyAdjustsScrollIndicatorInsets;
|
|
350
446
|
}
|
|
351
447
|
#endif
|
|
352
|
-
|
|
448
|
+
|
|
353
449
|
[self addSubview:_webView];
|
|
354
450
|
[self setHideKeyboardAccessoryView: _savedHideKeyboardAccessoryView];
|
|
355
451
|
[self setKeyboardDisplayRequiresUserAction: _savedKeyboardDisplayRequiresUserAction];
|
|
356
452
|
[self visitSource];
|
|
357
453
|
}
|
|
454
|
+
#if !TARGET_OS_OSX
|
|
455
|
+
// Allow this object to recognize gestures
|
|
456
|
+
if (self.menuItems != nil) {
|
|
457
|
+
UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(startLongPress:)];
|
|
458
|
+
longPress.delegate = self;
|
|
459
|
+
|
|
460
|
+
longPress.minimumPressDuration = 0.4f;
|
|
461
|
+
longPress.numberOfTouchesRequired = 1;
|
|
462
|
+
longPress.cancelsTouchesInView = YES;
|
|
463
|
+
[self addGestureRecognizer:longPress];
|
|
464
|
+
}
|
|
465
|
+
#endif // !TARGET_OS_OSX
|
|
358
466
|
}
|
|
359
467
|
|
|
360
468
|
// Update webview property when the component prop changes.
|
|
@@ -365,92 +473,92 @@ static NSDictionary* customCertificatesForHost;
|
|
|
365
473
|
|
|
366
474
|
- (void)removeFromSuperview
|
|
367
475
|
{
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
476
|
+
if (_webView) {
|
|
477
|
+
[_webView.configuration.userContentController removeScriptMessageHandlerForName:HistoryShimName];
|
|
478
|
+
[_webView.configuration.userContentController removeScriptMessageHandlerForName:MessageHandlerName];
|
|
479
|
+
[_webView removeObserver:self forKeyPath:@"estimatedProgress"];
|
|
480
|
+
[_webView removeFromSuperview];
|
|
373
481
|
#if !TARGET_OS_OSX
|
|
374
|
-
|
|
482
|
+
_webView.scrollView.delegate = nil;
|
|
375
483
|
#endif // !TARGET_OS_OSX
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
484
|
+
_webView = nil;
|
|
485
|
+
if (_onContentProcessDidTerminate) {
|
|
486
|
+
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
487
|
+
_onContentProcessDidTerminate(event);
|
|
381
488
|
}
|
|
382
|
-
|
|
383
|
-
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
[super removeFromSuperview];
|
|
384
492
|
}
|
|
385
493
|
|
|
386
494
|
#if !TARGET_OS_OSX
|
|
387
495
|
-(void)showFullScreenVideoStatusBars
|
|
388
496
|
{
|
|
389
497
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
498
|
+
if (!_autoManageStatusBarEnabled) {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
_isFullScreenVideoOpen = YES;
|
|
503
|
+
RCTUnsafeExecuteOnMainQueueSync(^{
|
|
504
|
+
[RCTSharedApplication() setStatusBarStyle:self->_savedStatusBarStyle animated:YES];
|
|
505
|
+
});
|
|
398
506
|
#pragma clang diagnostic pop
|
|
399
507
|
}
|
|
400
508
|
|
|
401
509
|
-(void)hideFullScreenVideoStatusBars
|
|
402
510
|
{
|
|
403
511
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
512
|
+
if (!_autoManageStatusBarEnabled) {
|
|
513
|
+
return;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
_isFullScreenVideoOpen = NO;
|
|
517
|
+
RCTUnsafeExecuteOnMainQueueSync(^{
|
|
518
|
+
[RCTSharedApplication() setStatusBarHidden:self->_savedStatusBarHidden animated:YES];
|
|
519
|
+
[RCTSharedApplication() setStatusBarStyle:self->_savedStatusBarStyle animated:YES];
|
|
520
|
+
});
|
|
413
521
|
#pragma clang diagnostic pop
|
|
414
522
|
}
|
|
415
523
|
|
|
416
524
|
-(void)keyboardWillHide
|
|
417
525
|
{
|
|
418
|
-
|
|
419
|
-
|
|
526
|
+
keyboardTimer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(keyboardDisplacementFix) userInfo:nil repeats:false];
|
|
527
|
+
[[NSRunLoop mainRunLoop] addTimer:keyboardTimer forMode:NSRunLoopCommonModes];
|
|
420
528
|
}
|
|
421
529
|
-(void)keyboardWillShow
|
|
422
530
|
{
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
531
|
+
if (keyboardTimer != nil) {
|
|
532
|
+
[keyboardTimer invalidate];
|
|
533
|
+
}
|
|
426
534
|
}
|
|
427
535
|
-(void)keyboardDisplacementFix
|
|
428
536
|
{
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
537
|
+
// Additional viewport checks to prevent unintentional scrolls
|
|
538
|
+
UIScrollView *scrollView = self.webView.scrollView;
|
|
539
|
+
double maxContentOffset = scrollView.contentSize.height - scrollView.frame.size.height;
|
|
540
|
+
if (maxContentOffset < 0) {
|
|
541
|
+
maxContentOffset = 0;
|
|
542
|
+
}
|
|
543
|
+
if (scrollView.contentOffset.y > maxContentOffset) {
|
|
544
|
+
// https://stackoverflow.com/a/9637807/824966
|
|
545
|
+
[UIView animateWithDuration:.25 animations:^{
|
|
546
|
+
scrollView.contentOffset = CGPointMake(0, maxContentOffset);
|
|
547
|
+
}];
|
|
548
|
+
}
|
|
441
549
|
}
|
|
442
550
|
#endif // !TARGET_OS_OSX
|
|
443
551
|
|
|
444
552
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary<NSKeyValueChangeKey,id> *)change context:(void *)context{
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
}
|
|
451
|
-
}else{
|
|
452
|
-
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
|
553
|
+
if ([keyPath isEqual:@"estimatedProgress"] && object == self.webView) {
|
|
554
|
+
if(_onLoadingProgress){
|
|
555
|
+
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
556
|
+
[event addEntriesFromDictionary:@{@"progress":[NSNumber numberWithDouble:self.webView.estimatedProgress]}];
|
|
557
|
+
_onLoadingProgress(event);
|
|
453
558
|
}
|
|
559
|
+
}else{
|
|
560
|
+
[super observeValueForKeyPath:keyPath ofObject:object change:change context:context];
|
|
561
|
+
}
|
|
454
562
|
}
|
|
455
563
|
|
|
456
564
|
#if !TARGET_OS_OSX
|
|
@@ -463,7 +571,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
463
571
|
if (_webView == nil) {
|
|
464
572
|
return;
|
|
465
573
|
}
|
|
466
|
-
|
|
574
|
+
|
|
467
575
|
CGFloat alpha = CGColorGetAlpha(backgroundColor.CGColor);
|
|
468
576
|
BOOL opaque = (alpha == 1.0);
|
|
469
577
|
#if !TARGET_OS_OSX
|
|
@@ -484,27 +592,27 @@ static NSDictionary* customCertificatesForHost;
|
|
|
484
592
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
|
485
593
|
- (void)setContentInsetAdjustmentBehavior:(UIScrollViewContentInsetAdjustmentBehavior)behavior
|
|
486
594
|
{
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
595
|
+
_savedContentInsetAdjustmentBehavior = behavior;
|
|
596
|
+
if (_webView == nil) {
|
|
597
|
+
return;
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
if ([_webView.scrollView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
|
|
601
|
+
CGPoint contentOffset = _webView.scrollView.contentOffset;
|
|
602
|
+
_webView.scrollView.contentInsetAdjustmentBehavior = behavior;
|
|
603
|
+
_webView.scrollView.contentOffset = contentOffset;
|
|
604
|
+
}
|
|
497
605
|
}
|
|
498
606
|
#endif
|
|
499
607
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 130000 /* __IPHONE_13_0 */
|
|
500
608
|
- (void)setAutomaticallyAdjustsScrollIndicatorInsets:(BOOL)automaticallyAdjustsScrollIndicatorInsets{
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
609
|
+
_savedAutomaticallyAdjustsScrollIndicatorInsets = automaticallyAdjustsScrollIndicatorInsets;
|
|
610
|
+
if (_webView == nil) {
|
|
611
|
+
return;
|
|
612
|
+
}
|
|
613
|
+
if ([_webView.scrollView respondsToSelector:@selector(setAutomaticallyAdjustsScrollIndicatorInsets:)]) {
|
|
614
|
+
_webView.scrollView.automaticallyAdjustsScrollIndicatorInsets = automaticallyAdjustsScrollIndicatorInsets;
|
|
615
|
+
}
|
|
508
616
|
}
|
|
509
617
|
#endif
|
|
510
618
|
/**
|
|
@@ -512,7 +620,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
512
620
|
* - window.webkit.messageHandlers[MessageHandlerName].postMessage
|
|
513
621
|
*/
|
|
514
622
|
- (void)userContentController:(WKUserContentController *)userContentController
|
|
515
|
-
|
|
623
|
+
didReceiveScriptMessage:(WKScriptMessage *)message
|
|
516
624
|
{
|
|
517
625
|
if ([message.name isEqualToString:HistoryShimName]) {
|
|
518
626
|
if (_onLoadingFinish) {
|
|
@@ -533,7 +641,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
533
641
|
{
|
|
534
642
|
if (![_source isEqualToDictionary:source]) {
|
|
535
643
|
_source = [source copy];
|
|
536
|
-
|
|
644
|
+
|
|
537
645
|
if (_webView != nil) {
|
|
538
646
|
[self visitSource];
|
|
539
647
|
}
|
|
@@ -544,7 +652,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
544
652
|
{
|
|
545
653
|
if (![_allowingReadAccessToURL isEqualToString:allowingReadAccessToURL]) {
|
|
546
654
|
_allowingReadAccessToURL = [allowingReadAccessToURL copy];
|
|
547
|
-
|
|
655
|
+
|
|
548
656
|
if (_webView != nil) {
|
|
549
657
|
[self visitSource];
|
|
550
658
|
}
|
|
@@ -570,153 +678,154 @@ static NSDictionary* customCertificatesForHost;
|
|
|
570
678
|
|
|
571
679
|
- (void)visitSource
|
|
572
680
|
{
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
[_webView loadHTMLString:html baseURL:baseURL];
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
//Add cookie for subsequent resource requests sent by page itself, if cookie was set in headers on WebView
|
|
584
|
-
NSString *headerCookie = [RCTConvert NSString:_source[@"headers"][@"cookie"]];
|
|
585
|
-
if(headerCookie) {
|
|
586
|
-
NSDictionary *headers = [NSDictionary dictionaryWithObjectsAndKeys:headerCookie,@"Set-Cookie",nil];
|
|
587
|
-
NSURL *urlString = [NSURL URLWithString:_source[@"uri"]];
|
|
588
|
-
NSArray *httpCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:headers forURL:urlString];
|
|
589
|
-
for (NSHTTPCookie *httpCookie in httpCookies) {
|
|
590
|
-
[_webView.configuration.websiteDataStore.httpCookieStore setCookie:httpCookie completionHandler:nil];
|
|
591
|
-
}
|
|
681
|
+
// Check for a static html source first
|
|
682
|
+
NSString *html = [RCTConvert NSString:_source[@"html"]];
|
|
683
|
+
if (html) {
|
|
684
|
+
NSURL *baseURL = [RCTConvert NSURL:_source[@"baseUrl"]];
|
|
685
|
+
if (!baseURL) {
|
|
686
|
+
baseURL = [NSURL URLWithString:@"about:blank"];
|
|
592
687
|
}
|
|
593
|
-
|
|
594
|
-
|
|
688
|
+
[_webView loadHTMLString:html baseURL:baseURL];
|
|
689
|
+
return;
|
|
690
|
+
}
|
|
691
|
+
// Add cookie for subsequent resource requests sent by page itself, if cookie was set in headers on WebView
|
|
692
|
+
NSString *headerCookie = [RCTConvert NSString:_source[@"headers"][@"cookie"]];
|
|
693
|
+
if(headerCookie) {
|
|
694
|
+
NSDictionary *headers = [NSDictionary dictionaryWithObjectsAndKeys:headerCookie,@"Set-Cookie",nil];
|
|
695
|
+
NSURL *urlString = [NSURL URLWithString:_source[@"uri"]];
|
|
696
|
+
NSArray *httpCookies = [NSHTTPCookie cookiesWithResponseHeaderFields:headers forURL:urlString];
|
|
697
|
+
[self writeCookiesToWebView:httpCookies completion:nil];
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
NSURLRequest *request = [self requestForSource:_source];
|
|
701
|
+
|
|
702
|
+
[self syncCookiesToWebView:^{
|
|
595
703
|
// Because of the way React works, as pages redirect, we actually end up
|
|
596
704
|
// passing the redirect urls back here, so we ignore them if trying to load
|
|
597
705
|
// the same url. We'll expose a call to 'reload' to allow a user to load
|
|
598
706
|
// the existing page.
|
|
599
707
|
if ([request.URL isEqual:_webView.URL]) {
|
|
600
|
-
|
|
708
|
+
return;
|
|
601
709
|
}
|
|
602
710
|
if (!request.URL) {
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
711
|
+
// Clear the webview
|
|
712
|
+
[_webView loadHTMLString:@"" baseURL:nil];
|
|
713
|
+
return;
|
|
606
714
|
}
|
|
607
715
|
if (request.URL.host) {
|
|
608
|
-
|
|
716
|
+
[_webView loadRequest:request];
|
|
609
717
|
}
|
|
610
718
|
else {
|
|
611
|
-
|
|
612
|
-
|
|
719
|
+
NSURL* readAccessUrl = _allowingReadAccessToURL ? [RCTConvert NSURL:_allowingReadAccessToURL] : request.URL;
|
|
720
|
+
[_webView loadFileURL:request.URL allowingReadAccessToURL:readAccessUrl];
|
|
613
721
|
}
|
|
722
|
+
}];
|
|
614
723
|
}
|
|
615
724
|
|
|
616
725
|
#if !TARGET_OS_OSX
|
|
617
726
|
-(void)setKeyboardDisplayRequiresUserAction:(BOOL)keyboardDisplayRequiresUserAction
|
|
618
727
|
{
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
728
|
+
if (_webView == nil) {
|
|
729
|
+
_savedKeyboardDisplayRequiresUserAction = keyboardDisplayRequiresUserAction;
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
if (_savedKeyboardDisplayRequiresUserAction == true) {
|
|
734
|
+
return;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
UIView* subview;
|
|
738
|
+
|
|
739
|
+
for (UIView* view in _webView.scrollView.subviews) {
|
|
740
|
+
if([[view.class description] hasPrefix:@"WK"])
|
|
741
|
+
subview = view;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
if(subview == nil) return;
|
|
745
|
+
|
|
746
|
+
Class class = subview.class;
|
|
747
|
+
|
|
748
|
+
NSOperatingSystemVersion iOS_11_3_0 = (NSOperatingSystemVersion){11, 3, 0};
|
|
749
|
+
NSOperatingSystemVersion iOS_12_2_0 = (NSOperatingSystemVersion){12, 2, 0};
|
|
750
|
+
NSOperatingSystemVersion iOS_13_0_0 = (NSOperatingSystemVersion){13, 0, 0};
|
|
751
|
+
|
|
752
|
+
Method method;
|
|
753
|
+
IMP override;
|
|
754
|
+
|
|
755
|
+
if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion: iOS_13_0_0]) {
|
|
756
|
+
// iOS 13.0.0 - Future
|
|
757
|
+
SEL selector = sel_getUid("_elementDidFocus:userIsInteracting:blurPreviousNode:activityStateChanges:userObject:");
|
|
758
|
+
method = class_getInstanceMethod(class, selector);
|
|
759
|
+
IMP original = method_getImplementation(method);
|
|
760
|
+
override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, BOOL arg3, id arg4) {
|
|
761
|
+
((void (*)(id, SEL, void*, BOOL, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3, arg4);
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
else if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion: iOS_12_2_0]) {
|
|
765
|
+
// iOS 12.2.0 - iOS 13.0.0
|
|
766
|
+
SEL selector = sel_getUid("_elementDidFocus:userIsInteracting:blurPreviousNode:changingActivityState:userObject:");
|
|
767
|
+
method = class_getInstanceMethod(class, selector);
|
|
768
|
+
IMP original = method_getImplementation(method);
|
|
769
|
+
override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, BOOL arg3, id arg4) {
|
|
770
|
+
((void (*)(id, SEL, void*, BOOL, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3, arg4);
|
|
771
|
+
});
|
|
772
|
+
}
|
|
773
|
+
else if ([[NSProcessInfo processInfo] isOperatingSystemAtLeastVersion: iOS_11_3_0]) {
|
|
774
|
+
// iOS 11.3.0 - 12.2.0
|
|
775
|
+
SEL selector = sel_getUid("_startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:");
|
|
776
|
+
method = class_getInstanceMethod(class, selector);
|
|
777
|
+
IMP original = method_getImplementation(method);
|
|
778
|
+
override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, BOOL arg3, id arg4) {
|
|
779
|
+
((void (*)(id, SEL, void*, BOOL, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3, arg4);
|
|
780
|
+
});
|
|
781
|
+
} else {
|
|
782
|
+
// iOS 9.0 - 11.3.0
|
|
783
|
+
SEL selector = sel_getUid("_startAssistingNode:userIsInteracting:blurPreviousNode:userObject:");
|
|
784
|
+
method = class_getInstanceMethod(class, selector);
|
|
785
|
+
IMP original = method_getImplementation(method);
|
|
786
|
+
override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, id arg3) {
|
|
787
|
+
((void (*)(id, SEL, void*, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3);
|
|
788
|
+
});
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
method_setImplementation(method, override);
|
|
683
792
|
}
|
|
684
793
|
|
|
685
794
|
-(void)setHideKeyboardAccessoryView:(BOOL)hideKeyboardAccessoryView
|
|
686
795
|
{
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
796
|
+
if (_webView == nil) {
|
|
797
|
+
_savedHideKeyboardAccessoryView = hideKeyboardAccessoryView;
|
|
798
|
+
return;
|
|
799
|
+
}
|
|
800
|
+
|
|
801
|
+
if (_savedHideKeyboardAccessoryView == false) {
|
|
802
|
+
return;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
UIView* subview;
|
|
806
|
+
|
|
807
|
+
for (UIView* view in _webView.scrollView.subviews) {
|
|
808
|
+
if([[view.class description] hasPrefix:@"WK"])
|
|
809
|
+
subview = view;
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
if(subview == nil) return;
|
|
813
|
+
|
|
814
|
+
NSString* name = [NSString stringWithFormat:@"%@_SwizzleHelperWK", subview.class.superclass];
|
|
815
|
+
Class newClass = NSClassFromString(name);
|
|
816
|
+
|
|
817
|
+
if(newClass == nil)
|
|
818
|
+
{
|
|
819
|
+
newClass = objc_allocateClassPair(subview.class, [name cStringUsingEncoding:NSASCIIStringEncoding], 0);
|
|
820
|
+
if(!newClass) return;
|
|
821
|
+
|
|
822
|
+
Method method = class_getInstanceMethod([_SwizzleHelperWK class], @selector(inputAccessoryView));
|
|
823
|
+
class_addMethod(newClass, @selector(inputAccessoryView), method_getImplementation(method), method_getTypeEncoding(method));
|
|
824
|
+
|
|
825
|
+
objc_registerClassPair(newClass);
|
|
826
|
+
}
|
|
827
|
+
|
|
828
|
+
object_setClass(subview, newClass);
|
|
720
829
|
}
|
|
721
830
|
|
|
722
831
|
// UIScrollViewDelegate method
|
|
@@ -726,6 +835,12 @@ static NSDictionary* customCertificatesForHost;
|
|
|
726
835
|
}
|
|
727
836
|
#endif // !TARGET_OS_OSX
|
|
728
837
|
|
|
838
|
+
- (void)setUserAgent:(NSString*)userAgent
|
|
839
|
+
{
|
|
840
|
+
_userAgent = userAgent;
|
|
841
|
+
_webView.customUserAgent = userAgent;
|
|
842
|
+
}
|
|
843
|
+
|
|
729
844
|
- (void)setScrollEnabled:(BOOL)scrollEnabled
|
|
730
845
|
{
|
|
731
846
|
_scrollEnabled = scrollEnabled;
|
|
@@ -745,45 +860,45 @@ static NSDictionary* customCertificatesForHost;
|
|
|
745
860
|
else if (_onScroll != nil) {
|
|
746
861
|
NSDictionary *event = @{
|
|
747
862
|
@"contentOffset": @{
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
863
|
+
@"x": @(scrollView.contentOffset.x),
|
|
864
|
+
@"y": @(scrollView.contentOffset.y)
|
|
865
|
+
},
|
|
751
866
|
@"contentInset": @{
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
867
|
+
@"top": @(scrollView.contentInset.top),
|
|
868
|
+
@"left": @(scrollView.contentInset.left),
|
|
869
|
+
@"bottom": @(scrollView.contentInset.bottom),
|
|
870
|
+
@"right": @(scrollView.contentInset.right)
|
|
871
|
+
},
|
|
757
872
|
@"contentSize": @{
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
873
|
+
@"width": @(scrollView.contentSize.width),
|
|
874
|
+
@"height": @(scrollView.contentSize.height)
|
|
875
|
+
},
|
|
761
876
|
@"layoutMeasurement": @{
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
877
|
+
@"width": @(scrollView.frame.size.width),
|
|
878
|
+
@"height": @(scrollView.frame.size.height)
|
|
879
|
+
},
|
|
765
880
|
@"zoomScale": @(scrollView.zoomScale ?: 1),
|
|
766
|
-
|
|
881
|
+
};
|
|
767
882
|
_onScroll(event);
|
|
768
883
|
}
|
|
769
884
|
}
|
|
770
885
|
|
|
771
886
|
- (void)setDirectionalLockEnabled:(BOOL)directionalLockEnabled
|
|
772
887
|
{
|
|
773
|
-
|
|
774
|
-
|
|
888
|
+
_directionalLockEnabled = directionalLockEnabled;
|
|
889
|
+
_webView.scrollView.directionalLockEnabled = directionalLockEnabled;
|
|
775
890
|
}
|
|
776
891
|
|
|
777
892
|
- (void)setShowsHorizontalScrollIndicator:(BOOL)showsHorizontalScrollIndicator
|
|
778
893
|
{
|
|
779
|
-
|
|
780
|
-
|
|
894
|
+
_showsHorizontalScrollIndicator = showsHorizontalScrollIndicator;
|
|
895
|
+
_webView.scrollView.showsHorizontalScrollIndicator = showsHorizontalScrollIndicator;
|
|
781
896
|
}
|
|
782
897
|
|
|
783
898
|
- (void)setShowsVerticalScrollIndicator:(BOOL)showsVerticalScrollIndicator
|
|
784
899
|
{
|
|
785
|
-
|
|
786
|
-
|
|
900
|
+
_showsVerticalScrollIndicator = showsVerticalScrollIndicator;
|
|
901
|
+
_webView.scrollView.showsVerticalScrollIndicator = showsVerticalScrollIndicator;
|
|
787
902
|
}
|
|
788
903
|
#endif // !TARGET_OS_OSX
|
|
789
904
|
|
|
@@ -791,8 +906,8 @@ static NSDictionary* customCertificatesForHost;
|
|
|
791
906
|
{
|
|
792
907
|
NSDictionary *eventInitDict = @{@"data": message};
|
|
793
908
|
NSString *source = [NSString
|
|
794
|
-
|
|
795
|
-
|
|
909
|
+
stringWithFormat:@"window.dispatchEvent(new MessageEvent('message', %@));",
|
|
910
|
+
RCTJSONStringify(eventInitDict, NULL)
|
|
796
911
|
];
|
|
797
912
|
[self injectJavaScript: source];
|
|
798
913
|
}
|
|
@@ -800,7 +915,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
800
915
|
- (void)layoutSubviews
|
|
801
916
|
{
|
|
802
917
|
[super layoutSubviews];
|
|
803
|
-
|
|
918
|
+
|
|
804
919
|
// Ensure webview takes the position and dimensions of BPCWebView
|
|
805
920
|
_webView.frame = self.bounds;
|
|
806
921
|
#if !TARGET_OS_OSX
|
|
@@ -825,43 +940,52 @@ static NSDictionary* customCertificatesForHost;
|
|
|
825
940
|
}
|
|
826
941
|
|
|
827
942
|
+ (void)setCustomCertificatesForHost:(nullable NSDictionary*)certificates {
|
|
828
|
-
|
|
943
|
+
customCertificatesForHost = certificates;
|
|
829
944
|
}
|
|
830
945
|
|
|
831
946
|
- (void) webView:(WKWebView *)webView
|
|
832
947
|
didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge
|
|
833
948
|
completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential * _Nullable))completionHandler
|
|
834
949
|
{
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
}
|
|
861
|
-
}
|
|
950
|
+
NSString* host = nil;
|
|
951
|
+
if (webView.URL != nil) {
|
|
952
|
+
host = webView.URL.host;
|
|
953
|
+
}
|
|
954
|
+
if ([[challenge protectionSpace] authenticationMethod] == NSURLAuthenticationMethodClientCertificate) {
|
|
955
|
+
completionHandler(NSURLSessionAuthChallengeUseCredential, clientAuthenticationCredential);
|
|
956
|
+
return;
|
|
957
|
+
}
|
|
958
|
+
if ([[challenge protectionSpace] serverTrust] != nil && customCertificatesForHost != nil && host != nil) {
|
|
959
|
+
SecCertificateRef localCertificate = (__bridge SecCertificateRef)([customCertificatesForHost objectForKey:host]);
|
|
960
|
+
if (localCertificate != nil) {
|
|
961
|
+
NSData *localCertificateData = (NSData*) CFBridgingRelease(SecCertificateCopyData(localCertificate));
|
|
962
|
+
SecTrustRef trust = [[challenge protectionSpace] serverTrust];
|
|
963
|
+
long count = SecTrustGetCertificateCount(trust);
|
|
964
|
+
for (long i = 0; i < count; i++) {
|
|
965
|
+
SecCertificateRef serverCertificate = SecTrustGetCertificateAtIndex(trust, i);
|
|
966
|
+
if (serverCertificate == nil) { continue; }
|
|
967
|
+
NSData *serverCertificateData = (NSData *) CFBridgingRelease(SecCertificateCopyData(serverCertificate));
|
|
968
|
+
if ([serverCertificateData isEqualToData:localCertificateData]) {
|
|
969
|
+
NSURLCredential *useCredential = [NSURLCredential credentialForTrust:trust];
|
|
970
|
+
if (challenge.sender != nil) {
|
|
971
|
+
[challenge.sender useCredential:useCredential forAuthenticationChallenge:challenge];
|
|
972
|
+
}
|
|
973
|
+
completionHandler(NSURLSessionAuthChallengeUseCredential, useCredential);
|
|
974
|
+
return;
|
|
862
975
|
}
|
|
976
|
+
}
|
|
863
977
|
}
|
|
864
|
-
|
|
978
|
+
}
|
|
979
|
+
if ([[challenge protectionSpace] authenticationMethod] == NSURLAuthenticationMethodHTTPBasic) {
|
|
980
|
+
NSString *username = [_basicAuthCredential valueForKey:@"username"];
|
|
981
|
+
NSString *password = [_basicAuthCredential valueForKey:@"password"];
|
|
982
|
+
if (username && password) {
|
|
983
|
+
NSURLCredential *credential = [NSURLCredential credentialWithUser:username password:password persistence:NSURLCredentialPersistenceNone];
|
|
984
|
+
completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
|
|
985
|
+
return;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
completionHandler(NSURLSessionAuthChallengePerformDefaultHandling, nil);
|
|
865
989
|
}
|
|
866
990
|
|
|
867
991
|
#pragma mark - WKNavigationDelegate methods
|
|
@@ -933,7 +1057,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
933
1057
|
#else
|
|
934
1058
|
NSAlert *alert = [[NSAlert alloc] init];
|
|
935
1059
|
[alert setMessageText:prompt];
|
|
936
|
-
|
|
1060
|
+
|
|
937
1061
|
const NSRect RCTSingleTextFieldFrame = NSMakeRect(0.0, 0.0, 275.0, 22.0);
|
|
938
1062
|
NSTextField *textField = [[NSTextField alloc] initWithFrame:RCTSingleTextFieldFrame];
|
|
939
1063
|
textField.cell.scrollable = YES;
|
|
@@ -942,7 +1066,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
942
1066
|
}
|
|
943
1067
|
textField.stringValue = defaultText;
|
|
944
1068
|
[alert setAccessoryView:textField];
|
|
945
|
-
|
|
1069
|
+
|
|
946
1070
|
[alert addButtonWithTitle:NSLocalizedString(@"OK", @"OK button")];
|
|
947
1071
|
[alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Cancel button")];
|
|
948
1072
|
[alert beginSheetModalForWindow:[NSApp keyWindow] completionHandler:^(NSModalResponse response) {
|
|
@@ -955,12 +1079,38 @@ static NSDictionary* customCertificatesForHost;
|
|
|
955
1079
|
#endif // !TARGET_OS_OSX
|
|
956
1080
|
}
|
|
957
1081
|
|
|
1082
|
+
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 150000 /* iOS 15 */
|
|
1083
|
+
/**
|
|
1084
|
+
* Media capture permissions (prevent multiple prompts)
|
|
1085
|
+
*/
|
|
1086
|
+
- (void) webView:(WKWebView *)webView
|
|
1087
|
+
requestMediaCapturePermissionForOrigin:(WKSecurityOrigin *)origin
|
|
1088
|
+
initiatedByFrame:(WKFrameInfo *)frame
|
|
1089
|
+
type:(WKMediaCaptureType)type
|
|
1090
|
+
decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler {
|
|
1091
|
+
if (_mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt || _mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_GrantIfSameHost_ElseDeny) {
|
|
1092
|
+
if ([origin.host isEqualToString:webView.URL.host]) {
|
|
1093
|
+
decisionHandler(WKPermissionDecisionGrant);
|
|
1094
|
+
} else {
|
|
1095
|
+
WKPermissionDecision decision = _mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt ? WKPermissionDecisionPrompt : WKPermissionDecisionDeny;
|
|
1096
|
+
decisionHandler(decision);
|
|
1097
|
+
}
|
|
1098
|
+
} else if (_mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_Deny) {
|
|
1099
|
+
decisionHandler(WKPermissionDecisionDeny);
|
|
1100
|
+
} else if (_mediaCapturePermissionGrantType == BPCWebViewPermissionGrantType_Grant) {
|
|
1101
|
+
decisionHandler(WKPermissionDecisionGrant);
|
|
1102
|
+
} else {
|
|
1103
|
+
decisionHandler(WKPermissionDecisionPrompt);
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
#endif
|
|
1107
|
+
|
|
958
1108
|
#if !TARGET_OS_OSX
|
|
959
1109
|
/**
|
|
960
1110
|
* topViewController
|
|
961
1111
|
*/
|
|
962
1112
|
-(UIViewController *)topViewController{
|
|
963
|
-
|
|
1113
|
+
return RCTPresentedViewController();
|
|
964
1114
|
}
|
|
965
1115
|
|
|
966
1116
|
#endif // !TARGET_OS_OSX
|
|
@@ -972,191 +1122,55 @@ static NSDictionary* customCertificatesForHost;
|
|
|
972
1122
|
- (void) webView:(WKWebView *)webView
|
|
973
1123
|
decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
|
|
974
1124
|
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
|
|
975
|
-
{
|
|
976
|
-
[self updateBlindViewIfNaverLogin:webView :navigationAction.request.URL.absoluteString];
|
|
977
|
-
|
|
978
|
-
if([self isItunesURL:navigationAction.request.URL.absoluteString]) {
|
|
979
|
-
[self startAppToApp:navigationAction.request.URL];
|
|
980
|
-
decisionHandler(WKNavigationActionPolicyCancel);
|
|
981
|
-
} else if(![navigationAction.request.URL.scheme isEqualToString:@"http"] && ![navigationAction.request.URL.scheme isEqualToString:@"https"] && ![navigationAction.request.URL.absoluteString isEqualToString:@"about:blank"]) {
|
|
982
|
-
[self startAppToApp:navigationAction.request.URL];
|
|
983
|
-
decisionHandler(WKNavigationActionPolicyCancel);
|
|
984
|
-
} else {
|
|
985
|
-
[self navigationOriginRN:webView decidePolicyForNavigationAction:navigationAction decisionHandler:decisionHandler];
|
|
986
|
-
}
|
|
987
|
-
}
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
- (void) updateBlindViewIfNaverLogin:(WKWebView*)webView :(NSString*)url {
|
|
991
|
-
if([url hasPrefix: @"https://nid.naver.com"]) {
|
|
992
|
-
[webView evaluateJavaScript: @"document.getElementById('back').remove();" completionHandler: ^(id result, NSError *error) {
|
|
993
|
-
|
|
994
|
-
}];
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
- (NSString*) getQueryStringParameter:(NSString*)url :(NSString*)param {
|
|
1000
|
-
NSMutableDictionary *queryStringDictionary = [[NSMutableDictionary alloc] init];
|
|
1001
|
-
NSArray *urlComponents = [url componentsSeparatedByString:@"&"];
|
|
1002
|
-
|
|
1003
|
-
for (NSString *keyValuePair in urlComponents)
|
|
1004
|
-
{
|
|
1005
|
-
NSArray *pairComponents = [keyValuePair componentsSeparatedByString:@"="];
|
|
1006
|
-
NSString *key = [[pairComponents firstObject] stringByRemovingPercentEncoding];
|
|
1007
|
-
NSString *value = [[pairComponents lastObject] stringByRemovingPercentEncoding];
|
|
1008
|
-
|
|
1009
|
-
if([param isEqualToString:key]) {
|
|
1010
|
-
return value;
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
return @"";
|
|
1015
|
-
}
|
|
1016
|
-
|
|
1017
|
-
- (void) startAppToApp:(NSURL*) url {
|
|
1018
|
-
UIApplication *application = [UIApplication sharedApplication];
|
|
1019
|
-
|
|
1020
|
-
// if (@available(iOS 10.0, *)) {
|
|
1021
|
-
// [application openURL:url options:@{} completionHandler:nil];
|
|
1022
|
-
// } else {
|
|
1023
|
-
// [application openURL:url];
|
|
1024
|
-
// }
|
|
1025
|
-
|
|
1026
|
-
if (@available(iOS 10.0, *)) {
|
|
1027
|
-
[application openURL:url options:@{} completionHandler: ^(BOOL success) {
|
|
1028
|
-
if(success == false) {
|
|
1029
|
-
[self startItunesToInstall:url];
|
|
1030
|
-
}
|
|
1031
|
-
}];
|
|
1032
|
-
} else {
|
|
1033
|
-
[application openURL:url];
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
- (void) startItunesToInstall:(NSURL*) url {
|
|
1039
|
-
NSString *sUrl = url.absoluteString;
|
|
1040
|
-
NSString *itunesUrl = @"";
|
|
1041
|
-
|
|
1042
|
-
if([sUrl hasPrefix: @"kfc-bankpay"]) {
|
|
1043
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EB%B1%85%ED%81%AC%ED%8E%98%EC%9D%B4-%EA%B8%88%EC%9C%B5%EA%B8%B0%EA%B4%80-%EA%B3%B5%EB%8F%99-%EA%B3%84%EC%A2%8C%EC%9D%B4%EC%B2%B4-%EA%B2%B0%EC%A0%9C-%EC%A0%9C%EB%A1%9C%ED%8E%98%EC%9D%B4/id398456030";
|
|
1044
|
-
} else if([sUrl hasPrefix: @"ispmobile"]) {
|
|
1045
|
-
itunesUrl = @"https://apps.apple.com/kr/app/isp/id369125087";
|
|
1046
|
-
} else if([sUrl hasPrefix: @"hdcardappcardansimclick"] || [sUrl hasPrefix: @"smhyundaiansimclick"]) {
|
|
1047
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%ED%98%84%EB%8C%80%EC%B9%B4%EB%93%9C/id702653088";
|
|
1048
|
-
} else if([sUrl hasPrefix: @"shinhan-sr-ansimclick"] || [sUrl hasPrefix: @"smshinhanansimclick"]) {
|
|
1049
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EC%8B%A0%ED%95%9C%ED%8E%98%EC%9D%B4%ED%8C%90/id572462317";
|
|
1050
|
-
} else if([sUrl hasPrefix: @"kb-acp"]) {
|
|
1051
|
-
itunesUrl = @"https://apps.apple.com/kr/app/kb-pay/id695436326";
|
|
1052
|
-
} else if([sUrl hasPrefix: @"liivbank"]) {
|
|
1053
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EB%A6%AC%EB%B8%8C/id1126232922";
|
|
1054
|
-
} else if([sUrl hasPrefix: @"mpocket.online.ansimclick"] || [sUrl hasPrefix: @"ansimclickscard"] || [sUrl hasPrefix: @"ansimclickipcollect"] || [sUrl hasPrefix: @"samsungpay"] || [sUrl hasPrefix: @"scardcertiapp"]) {
|
|
1055
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EC%82%BC%EC%84%B1%EC%B9%B4%EB%93%9C/id535125356";
|
|
1056
|
-
} else if([sUrl hasPrefix: @"lottesmartpay"]) {
|
|
1057
|
-
itunesUrl = @"https://apps.apple.com/us/app/%EB%A1%AF%EB%8D%B0%EC%B9%B4%EB%93%9C-%EC%95%B1%EC%B9%B4%EB%93%9C/id688047200";
|
|
1058
|
-
} else if([sUrl hasPrefix: @"lotteappcard"]) {
|
|
1059
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EB%94%94%EC%A7%80%EB%A1%9C%EC%B9%B4-%EB%A1%AF%EB%8D%B0%EC%B9%B4%EB%93%9C/id688047200";
|
|
1060
|
-
} else if([sUrl hasPrefix: @"newsmartpib"]) {
|
|
1061
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EC%9A%B0%EB%A6%AC-won-%EB%B1%85%ED%82%B9/id1470181651";
|
|
1062
|
-
} else if([sUrl hasPrefix: @"com.wooricard.wcard"]) {
|
|
1063
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EC%9A%B0%EB%A6%ACwon%EC%B9%B4%EB%93%9C/id1499598869";
|
|
1064
|
-
} else if([sUrl hasPrefix: @"citispay"] || [sUrl hasPrefix: @"citicardappkr"] || [sUrl hasPrefix: @"citimobileapp"]) {
|
|
1065
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EC%94%A8%ED%8B%B0%EB%AA%A8%EB%B0%94%EC%9D%BC/id1179759666";
|
|
1066
|
-
} else if([sUrl hasPrefix: @"shinsegaeeasypayment"]) {
|
|
1067
|
-
itunesUrl = @"https://apps.apple.com/kr/app/ssgpay/id666237916";
|
|
1068
|
-
} else if([sUrl hasPrefix: @"cloudpay"]) {
|
|
1069
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%ED%95%98%EB%82%98%EC%B9%B4%EB%93%9C-%EC%9B%90%ED%81%90%ED%8E%98%EC%9D%B4/id847268987";
|
|
1070
|
-
} else if([sUrl hasPrefix: @"hanawalletmembers"]) {
|
|
1071
|
-
itunesUrl = @"https://apps.apple.com/kr/app/n-wallet/id492190784";
|
|
1072
|
-
} else if([sUrl hasPrefix: @"nhappvardansimclick"]) {
|
|
1073
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EC%98%AC%EC%9B%90%ED%8E%98%EC%9D%B4-nh%EC%95%B1%EC%B9%B4%EB%93%9C/id1177889176";
|
|
1074
|
-
} else if([sUrl hasPrefix: @"nhallonepayansimclick"] || [sUrl hasPrefix: @"nhappcardansimclick"] || [sUrl hasPrefix: @"nhallonepayansimclick"] || [sUrl hasPrefix: @"nonghyupcardansimclick"]) {
|
|
1075
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EC%98%AC%EC%9B%90%ED%8E%98%EC%9D%B4-nh%EC%95%B1%EC%B9%B4%EB%93%9C/id1177889176";
|
|
1076
|
-
} else if([sUrl hasPrefix: @"payco"]) {
|
|
1077
|
-
itunesUrl = @"https://apps.apple.com/kr/app/payco/id924292102";
|
|
1078
|
-
} else if([sUrl hasPrefix: @"lpayapp"] || [sUrl hasPrefix: @"lmslpay"]) {
|
|
1079
|
-
itunesUrl = @"https://apps.apple.com/kr/app/l-point-with-l-pay/id473250588";
|
|
1080
|
-
} else if([sUrl hasPrefix: @"naversearchapp"]) {
|
|
1081
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EB%84%A4%EC%9D%B4%EB%B2%84-naver/id393499958";
|
|
1082
|
-
} else if([sUrl hasPrefix: @"tauthlink"]) {
|
|
1083
|
-
itunesUrl = @"https://apps.apple.com/kr/app/pass-by-skt/id1141258007";
|
|
1084
|
-
} else if([sUrl hasPrefix: @"uplusauth"] || [sUrl hasPrefix: @"upluscorporation"] ) {
|
|
1085
|
-
itunesUrl = @"https://apps.apple.com/kr/app/pass-by-u/id1147394645";
|
|
1086
|
-
} else if([sUrl hasPrefix: @"ktauthexternalcall"]) {
|
|
1087
|
-
itunesUrl = @"https://apps.apple.com/kr/app/pass-by-kt/id1134371550";
|
|
1088
|
-
} else if([sUrl hasPrefix: @"supertoss"]) {
|
|
1089
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%ED%86%A0%EC%8A%A4/id839333328";
|
|
1090
|
-
} else if([sUrl hasPrefix: @"kakaotalk"]) {
|
|
1091
|
-
itunesUrl = @"https://apps.apple.com/kr/app/kakaotalk/id362057947";
|
|
1092
|
-
} else if([sUrl hasPrefix: @"chaipayment"]) {
|
|
1093
|
-
itunesUrl = @"https://apps.apple.com/kr/app/%EC%B0%A8%EC%9D%B4/id1459979272";
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
if(itunesUrl.length > 0) {
|
|
1097
|
-
NSURL *appstore = [NSURL URLWithString: itunesUrl];
|
|
1098
|
-
[self startAppToApp: appstore];
|
|
1099
|
-
}
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
- (BOOL) isItunesURL:(NSString*) urlString {
|
|
1103
|
-
NSRange match = [urlString rangeOfString: @"itunes.apple.com"];
|
|
1104
|
-
return match.location != NSNotFound;
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
- (void) navigationOriginRN:(WKWebView *)webView
|
|
1109
|
-
decidePolicyForNavigationAction:(WKNavigationAction *)navigationAction
|
|
1110
|
-
decisionHandler:(void (^)(WKNavigationActionPolicy))decisionHandler
|
|
1111
1125
|
{
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1126
|
+
static NSDictionary<NSNumber *, NSString *> *navigationTypes;
|
|
1127
|
+
static dispatch_once_t onceToken;
|
|
1128
|
+
|
|
1129
|
+
dispatch_once(&onceToken, ^{
|
|
1130
|
+
navigationTypes = @{
|
|
1131
|
+
@(WKNavigationTypeLinkActivated): @"click",
|
|
1132
|
+
@(WKNavigationTypeFormSubmitted): @"formsubmit",
|
|
1133
|
+
@(WKNavigationTypeBackForward): @"backforward",
|
|
1134
|
+
@(WKNavigationTypeReload): @"reload",
|
|
1135
|
+
@(WKNavigationTypeFormResubmitted): @"formresubmit",
|
|
1136
|
+
@(WKNavigationTypeOther): @"other",
|
|
1137
|
+
};
|
|
1138
|
+
});
|
|
1139
|
+
|
|
1140
|
+
WKNavigationType navigationType = navigationAction.navigationType;
|
|
1141
|
+
NSURLRequest *request = navigationAction.request;
|
|
1142
|
+
BOOL isTopFrame = [request.URL isEqual:request.mainDocumentURL];
|
|
1143
|
+
|
|
1144
|
+
if (_onShouldStartLoadWithRequest) {
|
|
1145
|
+
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
1146
|
+
[event addEntriesFromDictionary: @{
|
|
1147
|
+
@"url": (request.URL).absoluteString,
|
|
1148
|
+
@"mainDocumentURL": (request.mainDocumentURL).absoluteString,
|
|
1149
|
+
@"navigationType": navigationTypes[@(navigationType)],
|
|
1150
|
+
@"isTopFrame": @(isTopFrame)
|
|
1151
|
+
}];
|
|
1152
|
+
if (![self.delegate webView:self
|
|
1153
|
+
shouldStartLoadForRequest:event
|
|
1154
|
+
withCallback:_onShouldStartLoadWithRequest]) {
|
|
1155
|
+
decisionHandler(WKNavigationActionPolicyCancel);
|
|
1156
|
+
return;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
if (_onLoadingStart) {
|
|
1161
|
+
// We have this check to filter out iframe requests and whatnot
|
|
1162
|
+
if (isTopFrame) {
|
|
1131
1163
|
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
1132
1164
|
[event addEntriesFromDictionary: @{
|
|
1133
1165
|
@"url": (request.URL).absoluteString,
|
|
1134
|
-
@"
|
|
1135
|
-
@"navigationType": navigationTypes[@(navigationType)],
|
|
1136
|
-
@"isTopFrame": @(isTopFrame)
|
|
1166
|
+
@"navigationType": navigationTypes[@(navigationType)]
|
|
1137
1167
|
}];
|
|
1138
|
-
|
|
1139
|
-
shouldStartLoadForRequest:event
|
|
1140
|
-
withCallback:_onShouldStartLoadWithRequest]) {
|
|
1141
|
-
decisionHandler(WKNavigationActionPolicyCancel);
|
|
1142
|
-
return;
|
|
1143
|
-
}
|
|
1168
|
+
_onLoadingStart(event);
|
|
1144
1169
|
}
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
1150
|
-
[event addEntriesFromDictionary: @{
|
|
1151
|
-
@"url": (request.URL).absoluteString,
|
|
1152
|
-
@"navigationType": navigationTypes[@(navigationType)]
|
|
1153
|
-
}];
|
|
1154
|
-
_onLoadingStart(event);
|
|
1155
|
-
}
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
|
-
// Allow all navigation by default
|
|
1159
|
-
decisionHandler(WKNavigationActionPolicyAllow);
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
// Allow all navigation by default
|
|
1173
|
+
decisionHandler(WKNavigationActionPolicyAllow);
|
|
1160
1174
|
}
|
|
1161
1175
|
|
|
1162
1176
|
/**
|
|
@@ -1185,17 +1199,17 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1185
1199
|
if ([navigationResponse.response isKindOfClass:[NSHTTPURLResponse class]]) {
|
|
1186
1200
|
NSHTTPURLResponse *response = (NSHTTPURLResponse *)navigationResponse.response;
|
|
1187
1201
|
NSInteger statusCode = response.statusCode;
|
|
1188
|
-
|
|
1202
|
+
|
|
1189
1203
|
if (statusCode >= 400) {
|
|
1190
1204
|
NSMutableDictionary<NSString *, id> *httpErrorEvent = [self baseEvent];
|
|
1191
1205
|
[httpErrorEvent addEntriesFromDictionary: @{
|
|
1192
1206
|
@"url": response.URL.absoluteString,
|
|
1193
1207
|
@"statusCode": @(statusCode)
|
|
1194
1208
|
}];
|
|
1195
|
-
|
|
1209
|
+
|
|
1196
1210
|
_onHttpError(httpErrorEvent);
|
|
1197
1211
|
}
|
|
1198
|
-
|
|
1212
|
+
|
|
1199
1213
|
NSString *disposition = nil;
|
|
1200
1214
|
if (@available(iOS 13, *)) {
|
|
1201
1215
|
disposition = [response valueForHTTPHeaderField:@"Content-Disposition"];
|
|
@@ -1204,7 +1218,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1204
1218
|
if (isAttachment || !navigationResponse.canShowMIMEType) {
|
|
1205
1219
|
if (_onFileDownload) {
|
|
1206
1220
|
policy = WKNavigationResponsePolicyCancel;
|
|
1207
|
-
|
|
1221
|
+
|
|
1208
1222
|
NSMutableDictionary<NSString *, id> *downloadEvent = [self baseEvent];
|
|
1209
1223
|
[downloadEvent addEntriesFromDictionary: @{
|
|
1210
1224
|
@"downloadUrl": (response.URL).absoluteString,
|
|
@@ -1214,7 +1228,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1214
1228
|
}
|
|
1215
1229
|
}
|
|
1216
1230
|
}
|
|
1217
|
-
|
|
1231
|
+
|
|
1218
1232
|
decisionHandler(policy);
|
|
1219
1233
|
}
|
|
1220
1234
|
|
|
@@ -1234,7 +1248,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1234
1248
|
// http://stackoverflow.com/questions/1024748/how-do-i-fix-nsurlerrordomain-error-999-in-iphone-3-0-os
|
|
1235
1249
|
return;
|
|
1236
1250
|
}
|
|
1237
|
-
|
|
1251
|
+
|
|
1238
1252
|
if ([error.domain isEqualToString:@"WebKitErrorDomain"] &&
|
|
1239
1253
|
(error.code == 102 || error.code == 101)) {
|
|
1240
1254
|
// Error code 102 "Frame load interrupted" is raised by the WKWebView
|
|
@@ -1242,7 +1256,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1242
1256
|
// implementing OAuth with a WebView.
|
|
1243
1257
|
return;
|
|
1244
1258
|
}
|
|
1245
|
-
|
|
1259
|
+
|
|
1246
1260
|
NSMutableDictionary<NSString *, id> *event = [self baseEvent];
|
|
1247
1261
|
[event addEntriesFromDictionary:@{
|
|
1248
1262
|
@"didFailProvisionalNavigation": @YES,
|
|
@@ -1273,26 +1287,26 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1273
1287
|
|
|
1274
1288
|
-(void)forceIgnoreSilentHardwareSwitch:(BOOL)initialSetup
|
|
1275
1289
|
{
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1290
|
+
NSString *mp3Str = @"data:audio/mp3;base64,//tAxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAAFAAAESAAzMzMzMzMzMzMzMzMzMzMzMzMzZmZmZmZmZmZmZmZmZmZmZmZmZmaZmZmZmZmZmZmZmZmZmZmZmZmZmczMzMzMzMzMzMzMzMzMzMzMzMzM//////////////////////////8AAAA5TEFNRTMuMTAwAZYAAAAAAAAAABQ4JAMGQgAAOAAABEhNIZS0AAAAAAD/+0DEAAPH3Yz0AAR8CPqyIEABp6AxjG/4x/XiInE4lfQDFwIIRE+uBgZoW4RL0OLMDFn6E5v+/u5ehf76bu7/6bu5+gAiIQGAABQIUJ0QolFghEn/9PhZQpcUTpXMjo0OGzRCZXyKxoIQzB2KhCtGobpT9TRVj/3Pmfp+f8X7Pu1B04sTnc3s0XhOlXoGVCMNo9X//9/r6a10TZEY5DsxqvO7mO5qFvpFCmKIjhpSItGsUYcRO//7QsQRgEiljQIAgLFJAbIhNBCa+JmorCbOi5q9nVd2dKnusTMQg4MFUlD6DQ4OFijwGAijRMfLbHG4nLVTjydyPlJTj8pfPflf9/5GD950A5e+jsrmNZSjSirjs1R7hnkia8vr//l/7Nb+crvr9Ok5ZJOylUKRxf/P9Zn0j2P4pJYXyKkeuy5wUYtdmOu6uobEtFqhIJViLEKIjGxchGev/L3Y0O3bwrIOszTBAZ7Ih28EUaSOZf/7QsQfg8fpjQIADN0JHbGgQBAZ8T//y//t/7d/2+f5m7MdCeo/9tdkMtGLbt1tqnabRroO1Qfvh20yEbei8nfDXP7btW7f9/uO9tbe5IvHQbLlxpf3DkAk0ojYcv///5/u3/7PTfGjPEPUvt5D6f+/3Lea4lz4tc4TnM/mFPrmalWbboeNiNyeyr+vufttZuvrVrt/WYv3T74JFo8qEDiJqJrmDTs///v99xDku2xG02jjunrICP/7QsQtA8kpkQAAgNMA/7FgQAGnobgfghgqA+uXwWQ3XFmGimSbe2X3ksY//KzK1a2k6cnNWOPJnPWUsYbKqkh8RJzrVf///P///////4vyhLKHLrCb5nIrYIUss4cthigL1lQ1wwNAc6C1pf1TIKRSkt+a//z+yLVcwlXKSqeSuCVQFLng2h4AFAFgTkH+Z/8jTX/zr//zsJV/5f//5UX/0ZNCNCCaf5lTCTRkaEdhNP//n/KUjf/7QsQ5AEhdiwAAjN7I6jGddBCO+WGTQ1mXrYatSAgaykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqg==";
|
|
1291
|
+
NSString *scr;
|
|
1292
|
+
if (initialSetup) {
|
|
1293
|
+
scr = [NSString stringWithFormat:@"var s=new Audio('%@');s.id='wkwebviewAudio';s.controls=false;s.loop=true;s.play();document.body.appendChild(s);true", mp3Str];
|
|
1294
|
+
} else {
|
|
1295
|
+
scr = [NSString stringWithFormat:@"var s=document.getElementById('wkwebviewAudio');s.src=null;s.parentNode.removeChild(s);s=null;s=new Audio('%@');s.id='wkwebviewAudio';s.controls=false;s.loop=true;s.play();document.body.appendChild(s);true", mp3Str];
|
|
1296
|
+
}
|
|
1297
|
+
[self evaluateJS: scr thenCall: nil];
|
|
1284
1298
|
}
|
|
1285
1299
|
|
|
1286
1300
|
-(void)disableIgnoreSilentSwitch
|
|
1287
1301
|
{
|
|
1288
|
-
|
|
1302
|
+
[self evaluateJS: @"document.getElementById('wkwebviewAudio').src=null;true" thenCall: nil];
|
|
1289
1303
|
}
|
|
1290
1304
|
|
|
1291
1305
|
-(void)appDidBecomeActive
|
|
1292
1306
|
{
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1307
|
+
if (_ignoreSilentHardwareSwitch) {
|
|
1308
|
+
[self forceIgnoreSilentHardwareSwitch:false];
|
|
1309
|
+
}
|
|
1296
1310
|
}
|
|
1297
1311
|
|
|
1298
1312
|
-(void)appWillResignActive
|
|
@@ -1307,12 +1321,21 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1307
1321
|
* @see https://fburl.com/rtys6jlb
|
|
1308
1322
|
*/
|
|
1309
1323
|
- (void)webView:(WKWebView *)webView
|
|
1310
|
-
|
|
1324
|
+
didFinishNavigation:(WKNavigation *)navigation
|
|
1311
1325
|
{
|
|
1326
|
+
if(_sharedCookiesEnabled && @available(iOS 11.0, *)) {
|
|
1327
|
+
// Write all cookies from WKWebView back to sharedHTTPCookieStorage
|
|
1328
|
+
[webView.configuration.websiteDataStore.httpCookieStore getAllCookies:^(NSArray* cookies) {
|
|
1329
|
+
for (NSHTTPCookie *cookie in cookies) {
|
|
1330
|
+
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookie:cookie];
|
|
1331
|
+
}
|
|
1332
|
+
}];
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1312
1335
|
if (_ignoreSilentHardwareSwitch) {
|
|
1313
1336
|
[self forceIgnoreSilentHardwareSwitch:true];
|
|
1314
1337
|
}
|
|
1315
|
-
|
|
1338
|
+
|
|
1316
1339
|
if (_onLoadingFinish) {
|
|
1317
1340
|
_onLoadingFinish([self baseEvent]);
|
|
1318
1341
|
}
|
|
@@ -1341,8 +1364,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1341
1364
|
* manually call [_webView loadRequest:request].
|
|
1342
1365
|
*/
|
|
1343
1366
|
NSURLRequest *request = [self requestForSource:self.source];
|
|
1344
|
-
|
|
1345
|
-
|
|
1367
|
+
|
|
1346
1368
|
if (request.URL && !_webView.URL.absoluteString.length) {
|
|
1347
1369
|
[_webView loadRequest:request];
|
|
1348
1370
|
} else {
|
|
@@ -1352,30 +1374,30 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1352
1374
|
#if !TARGET_OS_OSX
|
|
1353
1375
|
- (void)addPullToRefreshControl
|
|
1354
1376
|
{
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1377
|
+
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
|
|
1378
|
+
_refreshControl = refreshControl;
|
|
1379
|
+
[_webView.scrollView addSubview: refreshControl];
|
|
1380
|
+
[refreshControl addTarget:self action:@selector(pullToRefresh:) forControlEvents: UIControlEventValueChanged];
|
|
1359
1381
|
}
|
|
1360
1382
|
|
|
1361
1383
|
- (void)pullToRefresh:(UIRefreshControl *)refreshControl
|
|
1362
1384
|
{
|
|
1363
|
-
|
|
1364
|
-
|
|
1385
|
+
[self reload];
|
|
1386
|
+
[refreshControl endRefreshing];
|
|
1365
1387
|
}
|
|
1366
1388
|
|
|
1367
1389
|
|
|
1368
1390
|
- (void)setPullToRefreshEnabled:(BOOL)pullToRefreshEnabled
|
|
1369
1391
|
{
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1392
|
+
_pullToRefreshEnabled = pullToRefreshEnabled;
|
|
1393
|
+
|
|
1394
|
+
if (pullToRefreshEnabled) {
|
|
1395
|
+
[self addPullToRefreshControl];
|
|
1396
|
+
} else {
|
|
1397
|
+
[_refreshControl removeFromSuperview];
|
|
1398
|
+
}
|
|
1399
|
+
|
|
1400
|
+
[self setBounces:_bounces];
|
|
1379
1401
|
}
|
|
1380
1402
|
#endif // !TARGET_OS_OSX
|
|
1381
1403
|
|
|
@@ -1384,22 +1406,29 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1384
1406
|
[_webView stopLoading];
|
|
1385
1407
|
}
|
|
1386
1408
|
|
|
1409
|
+
- (void)requestFocus
|
|
1410
|
+
{
|
|
1411
|
+
#if !TARGET_OS_OSX
|
|
1412
|
+
[_webView becomeFirstResponder];
|
|
1413
|
+
#endif // !TARGET_OS_OSX
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1387
1416
|
#if !TARGET_OS_OSX
|
|
1388
1417
|
- (void)setBounces:(BOOL)bounces
|
|
1389
1418
|
{
|
|
1390
1419
|
_bounces = bounces;
|
|
1391
|
-
|
|
1420
|
+
//For UIRefreshControl to work correctly, the bounces should always be true
|
|
1392
1421
|
_webView.scrollView.bounces = _pullToRefreshEnabled || bounces;
|
|
1393
1422
|
}
|
|
1394
1423
|
#endif // !TARGET_OS_OSX
|
|
1395
1424
|
|
|
1396
1425
|
- (void)setInjectedJavaScript:(NSString *)source {
|
|
1397
1426
|
_injectedJavaScript = source;
|
|
1398
|
-
|
|
1427
|
+
|
|
1399
1428
|
self.atEndScript = source == nil ? nil : [[WKUserScript alloc] initWithSource:source
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1429
|
+
injectionTime:WKUserScriptInjectionTimeAtDocumentEnd
|
|
1430
|
+
forMainFrameOnly:_injectedJavaScriptForMainFrameOnly];
|
|
1431
|
+
|
|
1403
1432
|
if(_webView != nil){
|
|
1404
1433
|
[self resetupScripts:_webView.configuration];
|
|
1405
1434
|
}
|
|
@@ -1407,11 +1436,11 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1407
1436
|
|
|
1408
1437
|
- (void)setInjectedJavaScriptBeforeContentLoaded:(NSString *)source {
|
|
1409
1438
|
_injectedJavaScriptBeforeContentLoaded = source;
|
|
1410
|
-
|
|
1439
|
+
|
|
1411
1440
|
self.atStartScript = source == nil ? nil : [[WKUserScript alloc] initWithSource:source
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1441
|
+
injectionTime:WKUserScriptInjectionTimeAtDocumentStart
|
|
1442
|
+
forMainFrameOnly:_injectedJavaScriptBeforeContentLoadedForMainFrameOnly];
|
|
1443
|
+
|
|
1415
1444
|
if(_webView != nil){
|
|
1416
1445
|
[self resetupScripts:_webView.configuration];
|
|
1417
1446
|
}
|
|
@@ -1429,66 +1458,93 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1429
1458
|
|
|
1430
1459
|
- (void)setMessagingEnabled:(BOOL)messagingEnabled {
|
|
1431
1460
|
_messagingEnabled = messagingEnabled;
|
|
1432
|
-
|
|
1461
|
+
|
|
1433
1462
|
self.postMessageScript = _messagingEnabled ?
|
|
1434
1463
|
[
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1464
|
+
[WKUserScript alloc]
|
|
1465
|
+
initWithSource: [
|
|
1466
|
+
NSString
|
|
1467
|
+
stringWithFormat:
|
|
1468
|
+
@"window.%@ = {"
|
|
1469
|
+
" postMessage: function (data) {"
|
|
1470
|
+
" window.webkit.messageHandlers.%@.postMessage(String(data));"
|
|
1471
|
+
" }"
|
|
1472
|
+
"};", MessageHandlerName, MessageHandlerName
|
|
1473
|
+
]
|
|
1474
|
+
injectionTime:WKUserScriptInjectionTimeAtDocumentStart
|
|
1475
|
+
/* TODO: For a separate (minor) PR: use logic like this (as react-native-wkwebview does) so that messaging can be used in all frames if desired.
|
|
1476
|
+
* I am keeping it as YES for consistency with previous behaviour. */
|
|
1477
|
+
// forMainFrameOnly:_messagingEnabledForMainFrameOnly
|
|
1478
|
+
forMainFrameOnly:YES
|
|
1479
|
+
] :
|
|
1451
1480
|
nil;
|
|
1452
|
-
|
|
1481
|
+
|
|
1453
1482
|
if(_webView != nil){
|
|
1454
1483
|
[self resetupScripts:_webView.configuration];
|
|
1455
1484
|
}
|
|
1456
1485
|
}
|
|
1457
1486
|
|
|
1487
|
+
- (void)writeCookiesToWebView:(NSArray<NSHTTPCookie *>*)cookies completion:(void (^)(void))completion {
|
|
1488
|
+
// The required cookie APIs only became available on iOS 11
|
|
1489
|
+
if(_sharedCookiesEnabled && @available(iOS 11.0, *)) {
|
|
1490
|
+
dispatch_async(dispatch_get_main_queue(), ^{
|
|
1491
|
+
dispatch_group_t group = dispatch_group_create();
|
|
1492
|
+
for (NSHTTPCookie *cookie in cookies) {
|
|
1493
|
+
dispatch_group_enter(group);
|
|
1494
|
+
[_webView.configuration.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:^{
|
|
1495
|
+
dispatch_group_leave(group);
|
|
1496
|
+
}];
|
|
1497
|
+
}
|
|
1498
|
+
dispatch_group_notify(group, dispatch_get_main_queue(), ^{
|
|
1499
|
+
if (completion) {
|
|
1500
|
+
completion();
|
|
1501
|
+
}
|
|
1502
|
+
});
|
|
1503
|
+
});
|
|
1504
|
+
} else if (completion) {
|
|
1505
|
+
completion();
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
- (void)syncCookiesToWebView:(void (^)(void))completion {
|
|
1510
|
+
NSArray<NSHTTPCookie *> *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
|
|
1511
|
+
[self writeCookiesToWebView:cookies completion:completion];
|
|
1512
|
+
}
|
|
1513
|
+
|
|
1458
1514
|
- (void)resetupScripts:(WKWebViewConfiguration *)wkWebViewConfig {
|
|
1459
1515
|
[wkWebViewConfig.userContentController removeAllUserScripts];
|
|
1460
1516
|
[wkWebViewConfig.userContentController removeScriptMessageHandlerForName:MessageHandlerName];
|
|
1461
1517
|
if(self.enableApplePay){
|
|
1462
1518
|
if (self.postMessageScript){
|
|
1463
1519
|
[wkWebViewConfig.userContentController addScriptMessageHandler:[[BPCWeakScriptMessageDelegate alloc] initWithDelegate:self]
|
|
1464
|
-
|
|
1520
|
+
name:MessageHandlerName];
|
|
1465
1521
|
}
|
|
1466
1522
|
return;
|
|
1467
1523
|
}
|
|
1468
|
-
|
|
1524
|
+
|
|
1469
1525
|
NSString *html5HistoryAPIShimSource = [NSString stringWithFormat:
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1526
|
+
@"(function(history) {\n"
|
|
1527
|
+
" function notify(type) {\n"
|
|
1528
|
+
" setTimeout(function() {\n"
|
|
1529
|
+
" window.webkit.messageHandlers.%@.postMessage(type)\n"
|
|
1530
|
+
" }, 0)\n"
|
|
1531
|
+
" }\n"
|
|
1532
|
+
" function shim(f) {\n"
|
|
1533
|
+
" return function pushState() {\n"
|
|
1534
|
+
" notify('other')\n"
|
|
1535
|
+
" return f.apply(history, arguments)\n"
|
|
1536
|
+
" }\n"
|
|
1537
|
+
" }\n"
|
|
1538
|
+
" history.pushState = shim(history.pushState)\n"
|
|
1539
|
+
" history.replaceState = shim(history.replaceState)\n"
|
|
1540
|
+
" window.addEventListener('popstate', function() {\n"
|
|
1541
|
+
" notify('backforward')\n"
|
|
1542
|
+
" })\n"
|
|
1543
|
+
"})(window.history)\n", HistoryShimName
|
|
1488
1544
|
];
|
|
1489
1545
|
WKUserScript *script = [[WKUserScript alloc] initWithSource:html5HistoryAPIShimSource injectionTime:WKUserScriptInjectionTimeAtDocumentStart forMainFrameOnly:YES];
|
|
1490
1546
|
[wkWebViewConfig.userContentController addUserScript:script];
|
|
1491
|
-
|
|
1547
|
+
|
|
1492
1548
|
if(_sharedCookiesEnabled) {
|
|
1493
1549
|
// More info to sending cookies with WKWebView
|
|
1494
1550
|
// https://stackoverflow.com/questions/26573137/can-i-set-the-cookies-to-be-used-by-a-wkwebview/26577303#26577303
|
|
@@ -1499,12 +1555,10 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1499
1555
|
if(!_incognito && !_cacheEnabled) {
|
|
1500
1556
|
wkWebViewConfig.websiteDataStore = [WKWebsiteDataStore nonPersistentDataStore];
|
|
1501
1557
|
}
|
|
1502
|
-
|
|
1503
|
-
[wkWebViewConfig.websiteDataStore.httpCookieStore setCookie:cookie completionHandler:nil];
|
|
1504
|
-
}
|
|
1558
|
+
[self syncCookiesToWebView:nil];
|
|
1505
1559
|
} else {
|
|
1506
1560
|
NSMutableString *script = [NSMutableString string];
|
|
1507
|
-
|
|
1561
|
+
|
|
1508
1562
|
// Clear all existing cookies in a direct called function. This ensures that no
|
|
1509
1563
|
// javascript error will break the web content javascript.
|
|
1510
1564
|
// We keep this code here, if someone requires that Cookies are also removed within the
|
|
@@ -1513,48 +1567,48 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1513
1567
|
// Generates JS: document.cookie = "key=; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"
|
|
1514
1568
|
// for each cookie which is already available in the WebView context.
|
|
1515
1569
|
/*
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1570
|
+
[script appendString:@"(function () {\n"];
|
|
1571
|
+
[script appendString:@" var cookies = document.cookie.split('; ');\n"];
|
|
1572
|
+
[script appendString:@" for (var i = 0; i < cookies.length; i++) {\n"];
|
|
1573
|
+
[script appendString:@" if (cookies[i].indexOf('=') !== -1) {\n"];
|
|
1574
|
+
[script appendString:@" document.cookie = cookies[i].split('=')[0] + '=; Expires=Thu, 01 Jan 1970 00:00:01 GMT';\n"];
|
|
1575
|
+
[script appendString:@" }\n"];
|
|
1576
|
+
[script appendString:@" }\n"];
|
|
1577
|
+
[script appendString:@"})();\n\n"];
|
|
1578
|
+
*/
|
|
1579
|
+
|
|
1526
1580
|
// Set cookies in a direct called function. This ensures that no
|
|
1527
1581
|
// javascript error will break the web content javascript.
|
|
1528
|
-
|
|
1582
|
+
// Generates JS: document.cookie = "key=value; Path=/; Expires=Thu, 01 Jan 20xx 00:00:01 GMT;"
|
|
1529
1583
|
// for each cookie which is available in the application context.
|
|
1530
1584
|
[script appendString:@"(function () {\n"];
|
|
1531
1585
|
for (NSHTTPCookie *cookie in [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]) {
|
|
1532
1586
|
[script appendFormat:@"document.cookie = %@ + '=' + %@",
|
|
1533
|
-
|
|
1534
|
-
|
|
1587
|
+
RCTJSONStringify(cookie.name, NULL),
|
|
1588
|
+
RCTJSONStringify(cookie.value, NULL)];
|
|
1535
1589
|
if (cookie.path) {
|
|
1536
1590
|
[script appendFormat:@" + '; Path=' + %@", RCTJSONStringify(cookie.path, NULL)];
|
|
1537
1591
|
}
|
|
1538
1592
|
if (cookie.expiresDate) {
|
|
1539
1593
|
[script appendFormat:@" + '; Expires=' + new Date(%f).toUTCString()",
|
|
1540
|
-
|
|
1594
|
+
cookie.expiresDate.timeIntervalSince1970 * 1000
|
|
1541
1595
|
];
|
|
1542
1596
|
}
|
|
1543
1597
|
[script appendString:@";\n"];
|
|
1544
1598
|
}
|
|
1545
1599
|
[script appendString:@"})();\n"];
|
|
1546
|
-
|
|
1600
|
+
|
|
1547
1601
|
WKUserScript* cookieInScript = [[WKUserScript alloc] initWithSource:script
|
|
1548
1602
|
injectionTime:WKUserScriptInjectionTimeAtDocumentStart
|
|
1549
1603
|
forMainFrameOnly:YES];
|
|
1550
1604
|
[wkWebViewConfig.userContentController addUserScript:cookieInScript];
|
|
1551
1605
|
}
|
|
1552
1606
|
}
|
|
1553
|
-
|
|
1607
|
+
|
|
1554
1608
|
if(_messagingEnabled){
|
|
1555
1609
|
if (self.postMessageScript){
|
|
1556
1610
|
[wkWebViewConfig.userContentController addScriptMessageHandler:[[BPCWeakScriptMessageDelegate alloc] initWithDelegate:self]
|
|
1557
|
-
|
|
1611
|
+
name:MessageHandlerName];
|
|
1558
1612
|
[wkWebViewConfig.userContentController addUserScript:self.postMessageScript];
|
|
1559
1613
|
}
|
|
1560
1614
|
if (self.atEndScript) {
|
|
@@ -1569,7 +1623,7 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1569
1623
|
|
|
1570
1624
|
- (NSURLRequest *)requestForSource:(id)json {
|
|
1571
1625
|
NSURLRequest *request = [RCTConvert NSURLRequest:self.source];
|
|
1572
|
-
|
|
1626
|
+
|
|
1573
1627
|
// If sharedCookiesEnabled we automatically add all application cookies to the
|
|
1574
1628
|
// http request. This is automatically done on iOS 11+ in the WebView constructor.
|
|
1575
1629
|
// Se we need to manually add these shared cookies here only for iOS versions < 11.
|
|
@@ -1592,15 +1646,15 @@ static NSDictionary* customCertificatesForHost;
|
|
|
1592
1646
|
@implementation BPCWeakScriptMessageDelegate
|
|
1593
1647
|
|
|
1594
1648
|
- (instancetype)initWithDelegate:(id<WKScriptMessageHandler>)scriptDelegate {
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1649
|
+
self = [super init];
|
|
1650
|
+
if (self) {
|
|
1651
|
+
_scriptDelegate = scriptDelegate;
|
|
1652
|
+
}
|
|
1653
|
+
return self;
|
|
1600
1654
|
}
|
|
1601
1655
|
|
|
1602
1656
|
- (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message {
|
|
1603
|
-
|
|
1657
|
+
[self.scriptDelegate userContentController:userContentController didReceiveScriptMessage:message];
|
|
1604
1658
|
}
|
|
1605
1659
|
|
|
1606
1660
|
@end
|