react-native-webview-bootpay 13.8.42 → 13.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +53 -69
- package/android/build.gradle +1 -11
- package/android/gradle.properties +0 -42
- package/android/src/main/AndroidManifest.xml +3 -1
- package/android/src/main/AndroidManifestNew.xml +13 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +54 -10
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebView.java +101 -68
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewClient.java +68 -60
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewManagerImpl.kt +119 -65
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewMessagingModule.kt +9 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebViewModuleImpl.java +1 -1
- package/android/src/main/java/kr/co/bootpay/webview/BootpayUrlHelper.java +4 -12
- package/android/src/newarch/{com/reactnativecommunity → kr/co/bootpay}/webview/BPCWebViewManager.java +118 -109
- package/android/src/newarch/{com/reactnativecommunity → kr/co/bootpay}/webview/BPCWebViewModule.java +1 -1
- package/android/src/{main/java → oldarch}/kr/co/bootpay/webview/BPCWebViewManager.java +63 -58
- package/android/src/{main/java → oldarch}/kr/co/bootpay/webview/BPCWebViewModule.java +1 -1
- package/apple/BPCWebView.mm +21 -12
- package/apple/BPCWebViewImpl.h +11 -1
- package/apple/BPCWebViewImpl.m +278 -216
- package/apple/BPCWebViewManager.mm +5 -24
- package/apple/BPCWebViewModule.h +23 -0
- package/apple/BPCWebViewModule.mm +34 -0
- package/apple/RCTConvert+WKDataDetectorTypes.h +11 -0
- package/apple/RCTConvert+WKDataDetectorTypes.m +27 -0
- package/ios/RNCWebView.xcodeproj/project.pbxproj +24 -24
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/RNCWebView.xcodeproj/project.xcworkspace/xcuserdata/taesupyoon.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/RNCWebView.xcodeproj/xcuserdata/taesupyoon.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/lib/BPCWebViewNativeComponent.d.ts +24 -25
- package/lib/BPCWebViewNativeComponent.js +1 -1
- package/lib/{NativeBPCWebView.d.ts → NativeBPCWebViewModule.d.ts} +2 -5
- package/lib/{NativeBPCWebView.js → NativeBPCWebViewModule.js} +1 -1
- package/lib/WebView.android.d.ts +0 -1
- package/lib/WebView.android.js +1 -1
- package/lib/WebView.d.ts +0 -1
- package/lib/WebView.ios.d.ts +0 -1
- package/lib/WebView.ios.js +1 -1
- package/lib/WebView.js +1 -1
- package/lib/WebView.macos.d.ts +0 -1
- package/lib/WebView.macos.js +1 -1
- package/lib/WebView.styles.d.ts +37 -11
- package/lib/WebView.styles.js +1 -1
- package/lib/WebView.windows.d.ts +0 -1
- package/lib/WebView.windows.js +1 -1
- package/lib/WebViewNativeComponent.macos.d.ts +1 -2
- package/lib/WebViewNativeComponent.windows.d.ts +1 -2
- package/lib/WebViewShared.d.ts +0 -1
- package/lib/WebViewShared.js +1 -1
- package/lib/WebViewTypes.d.ts +51 -3
- package/lib/WebViewTypes.js +1 -1
- package/lib/index.d.ts +0 -1
- package/macos/RNCWebView.xcodeproj/project.pbxproj +36 -36
- package/package.json +13 -12
- package/react-native.config.js +1 -5
- package/src/BPCWebViewNativeComponent.ts +143 -79
- package/src/NativeBPCWebViewModule.ts +13 -0
- package/src/WebView.android.tsx +295 -190
- package/src/WebView.ios.tsx +253 -186
- package/src/WebView.macos.tsx +220 -152
- package/src/WebView.styles.ts +9 -12
- package/src/WebView.tsx +14 -7
- package/src/WebView.windows.tsx +180 -126
- package/src/WebViewNativeComponent.macos.ts +4 -5
- package/src/WebViewNativeComponent.windows.ts +6 -8
- package/src/WebViewShared.tsx +139 -91
- package/src/WebViewTypes.ts +80 -35
- package/src/__tests__/WebViewShared-test.js +170 -55
- package/windows/ReactNativeWebView/ReactNativeWebView.vcxproj +8 -17
- package/windows/ReactNativeWebView/ReactPackageProvider.cpp +5 -1
- package/windows/ReactNativeWebView/ReactWebView.cpp +73 -6
- package/windows/ReactNativeWebView/ReactWebView.h +11 -1
- package/windows/ReactNativeWebView/ReactWebView.idl +12 -3
- package/windows/ReactNativeWebView/ReactWebView2.cpp +294 -129
- package/windows/ReactNativeWebView/ReactWebView2.h +42 -5
- package/windows/ReactNativeWebView/ReactWebView2Manager.cpp +60 -34
- package/windows/ReactNativeWebView/ReactWebView2Manager.h +4 -4
- package/windows/ReactNativeWebView/ReactWebViewHelpers.cpp +70 -0
- package/windows/ReactNativeWebView/ReactWebViewHelpers.h +16 -0
- package/windows/ReactNativeWebView/ReactWebViewManager.cpp +22 -3
- package/windows/ReactNativeWebView/ReactWebViewManager.h +6 -1
- package/windows/ReactNativeWebView/pch.h +11 -7
- package/windows/ReactNativeWebView.sln +14 -14
- package/ios/main.jsbundle +0 -457
- package/lib/BPCWebViewNativeComponent.d.ts.map +0 -1
- package/lib/NativeBPCWebView.d.ts.map +0 -1
- package/lib/WebView.android.d.ts.map +0 -1
- package/lib/WebView.d.ts.map +0 -1
- package/lib/WebView.ios.d.ts.map +0 -1
- package/lib/WebView.macos.d.ts.map +0 -1
- package/lib/WebView.styles.d.ts.map +0 -1
- package/lib/WebView.windows.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.macos.d.ts.map +0 -1
- package/lib/WebViewNativeComponent.windows.d.ts.map +0 -1
- package/lib/WebViewShared.d.ts.map +0 -1
- package/lib/WebViewTypes.d.ts.map +0 -1
- package/lib/index.d.ts.map +0 -1
- package/react-native-webview-bootpay.podspec +0 -46
- package/src/NativeBPCWebView.ts +0 -14
- package/windows/ReactNativeWebView/packages.config +0 -5
- /package/android/src/main/java/kr/co/bootpay/webview/{BPCWebviewWrapper.kt → BPCWebViewWrapper.kt} +0 -0
package/README.md
CHANGED
|
@@ -1,73 +1,56 @@
|
|
|
1
|
-
#
|
|
1
|
+
# React Native WebView
|
|
2
2
|
|
|
3
|
-
react-native-webview
|
|
3
|
+

|
|
4
|
+
[](http://makeapullrequest.com)
|
|
5
|
+
[](https://www.npmjs.com/package/react-native-webview)
|
|
6
|
+

|
|
4
7
|
|
|
5
|
-
|
|
8
|
+
**React Native WebView** is a community-maintained WebView component for React Native. It is intended to be a replacement for the built-in WebView (which was [removed from core](https://github.com/react-native-community/discussions-and-proposals/pull/3)).
|
|
6
9
|
|
|
7
|
-
###
|
|
8
|
-
```sh
|
|
9
|
-
npm install react-native-webview-bootpay
|
|
10
|
-
```
|
|
10
|
+
### Maintainers
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
yarn add react-native-webview-bootpay
|
|
15
|
-
```
|
|
12
|
+
**Many thanks to these companies** for providing us with time to work on open source.
|
|
13
|
+
Please note that maintainers spend a lot of free time working on this too so feel free to sponsor them, **it really makes a difference.**
|
|
16
14
|
|
|
17
|
-
|
|
15
|
+
- [Thibault Malbranche](https://github.com/Titozzz) ([Twitter @titozzz](https://twitter.com/titozzz)) from [Brigad](https://www.brigad.co/en-gb/about-us)
|
|
16
|
+
[*Sponsor me* ❤️ !](https://github.com/sponsors/Titozzz)
|
|
18
17
|
|
|
19
|
-
```sh
|
|
20
|
-
"dependencies": {
|
|
21
|
-
"react-native-webview-bootpay": last_version
|
|
22
|
-
}
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
Windows and macOS are managed by Microsoft, notably:
|
|
20
|
+
- [Alexander Sklar](https://github.com/asklar) ([Twitter @alexsklar](https://twitter.com/alexsklar)) from [React Native for Windows](https://microsoft.github.io/react-native-windows/)
|
|
21
|
+
- [Chiara Mooney](https://github.com/chiaramooney) from [React Native for Windows @ Microsoft](https://microsoft.github.io/react-native-windows/)
|
|
25
22
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
###
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
<key>NSAppTransportSecurity</key>
|
|
42
|
-
<dict>
|
|
43
|
-
<key>NSAllowsArbitraryLoads</key>
|
|
44
|
-
<true/>
|
|
45
|
-
</dict>
|
|
46
|
-
<key>CFBundleURLTypes</key>
|
|
47
|
-
<array>
|
|
48
|
-
<dict>
|
|
49
|
-
<key>CFBundleTypeRole</key>
|
|
50
|
-
<string>Editor</string>
|
|
51
|
-
<key>CFBundleURLName</key>
|
|
52
|
-
<string>kr.co.bootpaySample</string>
|
|
53
|
-
<key>CFBundleURLSchemes</key>
|
|
54
|
-
<array>
|
|
55
|
-
<string>bootpaySample</string>
|
|
56
|
-
</array>
|
|
57
|
-
</dict>
|
|
58
|
-
</array>
|
|
59
|
-
|
|
60
|
-
...
|
|
61
|
-
</dict>
|
|
62
|
-
</plist>
|
|
63
|
-
```
|
|
23
|
+
Shout-out to [Jamon Holmgren](https://github.com/jamonholmgren) from [Infinite Red](https://infinite.red) for helping a lot with the repo when he had more available time.
|
|
24
|
+
|
|
25
|
+
### Disclaimer
|
|
26
|
+
|
|
27
|
+
Maintaining WebView is very complex because it is often used for many different use cases (rendering SVGs, PDFs, login flows, and much more). We also support many platforms and both architectures of react-native.
|
|
28
|
+
|
|
29
|
+
Since WebView was extracted from the React Native core, nearly 500 pull requests have been merged.
|
|
30
|
+
Considering that we have limited time, issues will mostly serve as a discussion place for the community, while **we will prioritize reviewing and merging pull requests.**
|
|
31
|
+
|
|
32
|
+
### Platform compatibility
|
|
33
|
+
|
|
34
|
+
This project is compatible with **iOS**, **Android**, **Windows** and **macOS**.
|
|
35
|
+
This project supports both **the old** (paper) **and the new architecture** (fabric).
|
|
36
|
+
This project is compatible with [expo](https://docs.expo.dev/versions/latest/sdk/webview/).
|
|
64
37
|
|
|
65
|
-
|
|
38
|
+
### Getting Started
|
|
39
|
+
|
|
40
|
+
Read our [Getting Started Guide](docs/Getting-Started.md). If any step seems unclear, please create a pull request.
|
|
41
|
+
|
|
42
|
+
### Versioning
|
|
43
|
+
|
|
44
|
+
This project follows [semantic versioning](https://semver.org/). We do not hesitate to release breaking changes but they will be in a major version.
|
|
45
|
+
|
|
46
|
+
### Usage
|
|
47
|
+
|
|
48
|
+
Import the `WebView` component from `react-native-webview` and use it like so:
|
|
66
49
|
|
|
67
50
|
```tsx
|
|
68
51
|
import React, { Component } from 'react';
|
|
69
52
|
import { StyleSheet, Text, View } from 'react-native';
|
|
70
|
-
import { WebView } from 'react-native-webview
|
|
53
|
+
import { WebView } from 'react-native-webview';
|
|
71
54
|
|
|
72
55
|
// ...
|
|
73
56
|
const MyWebComponent = () => {
|
|
@@ -75,24 +58,25 @@ const MyWebComponent = () => {
|
|
|
75
58
|
}
|
|
76
59
|
```
|
|
77
60
|
|
|
78
|
-
|
|
79
|
-
```
|
|
80
|
-
window.BootpayRNWebView.postMessage("test data"); //부트페이 웹뷰
|
|
81
|
-
```
|
|
82
|
-
사용 방법은 react-native-webview와 동일하며 javascript interface 이름이 ReactNativeWebView 가 아닌 BootpayRNWebView 값으로 보내주시면 되겠습니다.
|
|
83
|
-
|
|
84
|
-
## Documentation
|
|
61
|
+
For more, read the [API Reference](./docs/Reference.md) and [Guide](./docs/Guide.md). If you're interested in contributing, check out the [Contributing Guide](./docs/Contributing.md).
|
|
85
62
|
|
|
86
|
-
|
|
63
|
+
### Common issues
|
|
87
64
|
|
|
88
|
-
|
|
65
|
+
- If you're getting `Invariant Violation: Native component for "RNCWebView does not exist"` it likely means you forgot to run `react-native link` or there was some error with the linking process
|
|
66
|
+
- If you encounter a build error during the task `:app:mergeDexRelease`, you need to enable multidex support in `android/app/build.gradle` as discussed in [this issue](https://github.com/react-native-webview/react-native-webview/issues/1344#issuecomment-650544648)
|
|
89
67
|
|
|
90
|
-
|
|
68
|
+
#### Contributing
|
|
91
69
|
|
|
92
|
-
|
|
70
|
+
Contributions are welcome, see [Contributing.md](https://github.com/react-native-webview/react-native-webview/blob/master/docs/Contributing.md)
|
|
93
71
|
|
|
94
|
-
|
|
72
|
+
### License
|
|
95
73
|
|
|
74
|
+
MIT
|
|
96
75
|
|
|
76
|
+
### Translations
|
|
97
77
|
|
|
78
|
+
This readme is available in:
|
|
98
79
|
|
|
80
|
+
- [Brazilian portuguese](docs/README.portuguese.md)
|
|
81
|
+
- [French](docs/README.french.md)
|
|
82
|
+
- [Italian](docs/README.italian.md)
|
package/android/build.gradle
CHANGED
|
@@ -64,7 +64,7 @@ android {
|
|
|
64
64
|
|
|
65
65
|
sourceSets {
|
|
66
66
|
main {
|
|
67
|
-
manifest.srcFile "src/main/
|
|
67
|
+
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -108,13 +108,3 @@ dependencies {
|
|
|
108
108
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:${safeExtGet('kotlinVersion')}"
|
|
109
109
|
implementation "androidx.webkit:webkit:${safeExtGet('webkitVersion')}"
|
|
110
110
|
}
|
|
111
|
-
|
|
112
|
-
// if (isNewArchitectureEnabled()) {
|
|
113
|
-
// react {
|
|
114
|
-
// jsRootDir = file("../src/")
|
|
115
|
-
// libraryName = "BPCWebView"
|
|
116
|
-
// codegenJavaPackageName = "kr.co.bootpay.webview"
|
|
117
|
-
// codegenDir = new File(codegenPath)
|
|
118
|
-
// reactNativeDir = new File(reactNativePath)
|
|
119
|
-
// }
|
|
120
|
-
// }
|
|
@@ -3,45 +3,3 @@ ReactNativeWebViewBootpay_webkitVersion=1.4.0
|
|
|
3
3
|
ReactNativeWebViewBootpay_compileSdkVersion=31
|
|
4
4
|
ReactNativeWebViewBootpay_targetSdkVersion=31
|
|
5
5
|
ReactNativeWebViewBootpay_minSdkVersion=21
|
|
6
|
-
|
|
7
|
-
# Project-wide Gradle settings.
|
|
8
|
-
|
|
9
|
-
# IDE (e.g. Android Studio) users:
|
|
10
|
-
# Gradle settings configured through the IDE *will override*
|
|
11
|
-
# any settings specified in this file.
|
|
12
|
-
|
|
13
|
-
# For more details on how to configure your build environment visit
|
|
14
|
-
# http://www.gradle.org/docs/current/userguide/build_environment.html
|
|
15
|
-
|
|
16
|
-
# Specifies the JVM arguments used for the daemon process.
|
|
17
|
-
# The setting is particularly useful for tweaking memory settings.
|
|
18
|
-
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
|
|
19
|
-
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
|
|
20
|
-
|
|
21
|
-
# When configured, Gradle will run in incubating parallel mode.
|
|
22
|
-
# This option should only be used with decoupled projects. More details, visit
|
|
23
|
-
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
|
|
24
|
-
# org.gradle.parallel=true
|
|
25
|
-
|
|
26
|
-
# AndroidX package structure to make it clearer which packages are bundled with the
|
|
27
|
-
# Android operating system, and which are packaged with your app's APK
|
|
28
|
-
# https://developer.android.com/topic/libraries/support-library/androidx-rn
|
|
29
|
-
android.useAndroidX=true
|
|
30
|
-
# Automatically convert third-party libraries to use AndroidX
|
|
31
|
-
android.enableJetifier=true
|
|
32
|
-
|
|
33
|
-
# Use this property to specify which architecture you want to build.
|
|
34
|
-
# You can also override it from the CLI using
|
|
35
|
-
# ./gradlew <task> -PreactNativeArchitectures=x86_64
|
|
36
|
-
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
|
|
37
|
-
|
|
38
|
-
# Use this property to enable support to the new architecture.
|
|
39
|
-
# This will allow you to use TurboModules and the Fabric render in
|
|
40
|
-
# your application. You should enable this flag either if you want
|
|
41
|
-
# to write custom TurboModules/Fabric components OR use libraries that
|
|
42
|
-
# are providing them.
|
|
43
|
-
newArchEnabled=false
|
|
44
|
-
|
|
45
|
-
# Use this property to enable or disable the Hermes JS engine.
|
|
46
|
-
# If set to false, you will be using JSC instead.
|
|
47
|
-
hermesEnabled=true
|
|
@@ -11,7 +11,9 @@
|
|
|
11
11
|
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
12
12
|
android:resource="@xml/file_provider_paths" />
|
|
13
13
|
</provider>
|
|
14
|
-
</application
|
|
14
|
+
</application>
|
|
15
|
+
|
|
16
|
+
<!-- android 11 모든 앱 접근 권한 사용 (Google Play 가이드라인 참고 - 2021-02-19 기준 못찾았음) -->
|
|
15
17
|
<!-- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" tools:ignore="QueryAllPackagesPermission" />-->
|
|
16
18
|
<!-- android 11 Package Visibility 설정 (compileSdkVersion, targetSdkVersion 30 이상 설정시 필수) -->
|
|
17
19
|
<!-- 2021-02-19 -->
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<application>
|
|
3
|
+
<provider
|
|
4
|
+
android:name=".BPCWebViewFileProvider"
|
|
5
|
+
android:authorities="${applicationId}.fileprovider"
|
|
6
|
+
android:exported="false"
|
|
7
|
+
android:grantUriPermissions="true">
|
|
8
|
+
<meta-data
|
|
9
|
+
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
10
|
+
android:resource="@xml/file_provider_paths" />
|
|
11
|
+
</provider>
|
|
12
|
+
</application>
|
|
13
|
+
</manifest>
|
|
@@ -24,8 +24,7 @@ import android.webkit.WebChromeClient;
|
|
|
24
24
|
import android.webkit.WebView;
|
|
25
25
|
import android.webkit.WebViewClient;
|
|
26
26
|
import android.widget.FrameLayout;
|
|
27
|
-
|
|
28
|
-
import android.app.AlertDialog;
|
|
27
|
+
|
|
29
28
|
import android.content.Intent;
|
|
30
29
|
import android.annotation.SuppressLint;
|
|
31
30
|
import android.net.http.SslError;
|
|
@@ -35,12 +34,14 @@ import androidx.core.content.ContextCompat;
|
|
|
35
34
|
|
|
36
35
|
import com.facebook.react.bridge.Arguments;
|
|
37
36
|
import com.facebook.react.bridge.LifecycleEventListener;
|
|
37
|
+
import com.facebook.react.bridge.ReactNoCrashSoftException;
|
|
38
38
|
import com.facebook.react.bridge.WritableMap;
|
|
39
39
|
import com.facebook.react.common.build.ReactBuildConfig;
|
|
40
40
|
import com.facebook.react.modules.core.PermissionAwareActivity;
|
|
41
41
|
import com.facebook.react.modules.core.PermissionListener;
|
|
42
42
|
import com.facebook.react.uimanager.UIManagerHelper;
|
|
43
43
|
import com.facebook.react.uimanager.ThemedReactContext;
|
|
44
|
+
import com.facebook.react.uimanager.UIManagerModule;
|
|
44
45
|
|
|
45
46
|
|
|
46
47
|
import kr.co.bootpay.webview.events.TopLoadingProgressEvent;
|
|
@@ -58,6 +59,7 @@ import android.widget.Toast;
|
|
|
58
59
|
|
|
59
60
|
import org.json.JSONException;
|
|
60
61
|
import org.json.JSONObject;
|
|
62
|
+
import android.content.DialogInterface;
|
|
61
63
|
|
|
62
64
|
public class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListener {
|
|
63
65
|
protected static final FrameLayout.LayoutParams FULLSCREEN_LAYOUT_PARAMS = new FrameLayout.LayoutParams(
|
|
@@ -102,21 +104,27 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
102
104
|
protected BPCWebView.ProgressChangedFilter progressChangedFilter = null;
|
|
103
105
|
protected boolean mAllowsProtectedMedia = false;
|
|
104
106
|
|
|
105
|
-
protected boolean mHasOnOpenWindowEvent = false;
|
|
107
|
+
protected boolean mHasOnOpenWindowEvent = false;
|
|
106
108
|
|
|
107
109
|
public BPCWebChromeClient(BPCWebView webView) {
|
|
108
110
|
this.mWebView = webView;
|
|
109
111
|
}
|
|
112
|
+
|
|
110
113
|
|
|
114
|
+
boolean isPopupWebView = false;
|
|
111
115
|
@Override
|
|
112
116
|
public boolean onCreateWindow(WebView view, boolean isDialog, boolean isUserGesture, Message resultMsg) {
|
|
113
117
|
|
|
114
|
-
|
|
118
|
+
ThemedReactContext reactContext = (ThemedReactContext) view.getContext();
|
|
119
|
+
final BPCWebView newWebView = new BPCWebView(reactContext);
|
|
115
120
|
|
|
116
121
|
BPCWebChromeClient client = new BPCWebChromeClient(newWebView);
|
|
117
122
|
client.setProgressChangedFilter(progressChangedFilter);
|
|
118
123
|
newWebView.setWebChromeClient(client);
|
|
119
124
|
|
|
125
|
+
Log.d("BPCWebChromeClient", "onCreateWindow");
|
|
126
|
+
isPopupWebView = true;
|
|
127
|
+
|
|
120
128
|
setWebSettingCopy(view, newWebView);
|
|
121
129
|
|
|
122
130
|
|
|
@@ -159,6 +167,22 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
159
167
|
final WebView.WebViewTransport transport = (WebView.WebViewTransport) resultMsg.obj;
|
|
160
168
|
transport.setWebView(newWebView);
|
|
161
169
|
resultMsg.sendToTarget();
|
|
170
|
+
|
|
171
|
+
// 🔹 팝업을 위한 FrameLayout을 React Native UI 트리에 추가
|
|
172
|
+
// Activity activity = reactContext.getCurrentActivity();
|
|
173
|
+
// if (activity != null) {
|
|
174
|
+
// activity.runOnUiThread(() -> {
|
|
175
|
+
// FrameLayout popupContainer = new FrameLayout(activity);
|
|
176
|
+
// popupContainer.setLayoutParams(new FrameLayout.LayoutParams(
|
|
177
|
+
// ViewGroup.LayoutParams.MATCH_PARENT,
|
|
178
|
+
// ViewGroup.LayoutParams.MATCH_PARENT
|
|
179
|
+
// ));
|
|
180
|
+
// popupContainer.addView(newWebView);
|
|
181
|
+
// ((ViewGroup) activity.findViewById(android.R.id.content)).addView(popupContainer);
|
|
182
|
+
// });
|
|
183
|
+
// } else {
|
|
184
|
+
// Log.e("BPCWebChromeClient", "Activity is null, cannot add popup WebView.");
|
|
185
|
+
// }
|
|
162
186
|
|
|
163
187
|
|
|
164
188
|
return true;
|
|
@@ -169,6 +193,10 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
169
193
|
public void onCloseWindow(WebView window) {
|
|
170
194
|
super.onCloseWindow(window);
|
|
171
195
|
((BPCWebView) window).dissmissDialog();
|
|
196
|
+
|
|
197
|
+
Log.d("BPCWebChromeClient", "onCloseWindow");
|
|
198
|
+
|
|
199
|
+
isPopupWebView = false;
|
|
172
200
|
// if(mainView != null) {
|
|
173
201
|
// mainView.removeView(window);
|
|
174
202
|
// }
|
|
@@ -176,9 +204,11 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
176
204
|
}
|
|
177
205
|
|
|
178
206
|
|
|
207
|
+
|
|
208
|
+
|
|
179
209
|
void setWebSettingCopy(WebView view, WebView newWebView) {
|
|
180
210
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
|
|
181
|
-
|
|
211
|
+
newWebView.getSettings().setMediaPlaybackRequiresUserGesture( view.getSettings().getMediaPlaybackRequiresUserGesture() );
|
|
182
212
|
}
|
|
183
213
|
|
|
184
214
|
newWebView.getSettings().setBuiltInZoomControls(view.getSettings().getBuiltInZoomControls());
|
|
@@ -216,17 +246,17 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
216
246
|
newWebView.getSettings().setCacheMode(view.getSettings().getCacheMode());
|
|
217
247
|
|
|
218
248
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
|
219
|
-
|
|
249
|
+
newWebView.getSettings().setMixedContentMode(view.getSettings().getMixedContentMode());
|
|
220
250
|
}
|
|
221
251
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
|
222
|
-
|
|
252
|
+
newWebView.getSettings().setSafeBrowsingEnabled(view.getSettings().getSafeBrowsingEnabled());
|
|
223
253
|
}
|
|
224
254
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
|
225
|
-
|
|
255
|
+
newWebView.getSettings().setForceDark(view.getSettings().getForceDark());
|
|
226
256
|
}
|
|
227
257
|
|
|
228
258
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
|
229
|
-
|
|
259
|
+
newWebView.getSettings().setDisabledActionModeMenuItems(view.getSettings().getDisabledActionModeMenuItems());
|
|
230
260
|
}
|
|
231
261
|
}
|
|
232
262
|
|
|
@@ -246,6 +276,19 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
246
276
|
if (progressChangedFilter.isWaitingForCommandLoadUrl()) {
|
|
247
277
|
return;
|
|
248
278
|
}
|
|
279
|
+
|
|
280
|
+
if(isPopupWebView) {
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
Log.e("BPCWebChromeClient", "" + isPopupWebView);
|
|
285
|
+
// if(this.mWebView == null || this.mWebView.getThemedReactContext() == null) return;
|
|
286
|
+
// UIManagerModule uiManager = (this.mWebView.getThemedReactContext()).getNativeModule(UIManagerModule.class);
|
|
287
|
+
// if (uiManager == null) {
|
|
288
|
+
// Log.e("BPCWebChromeClient", "UIManagerModule is null, skipping event dispatch.");
|
|
289
|
+
// return;
|
|
290
|
+
// }
|
|
291
|
+
|
|
249
292
|
int reactTag = BPCWebViewWrapper.getReactTagFromWebView(webView);
|
|
250
293
|
WritableMap event = Arguments.createMap();
|
|
251
294
|
event.putDouble("target", reactTag);
|
|
@@ -255,7 +298,8 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
255
298
|
event.putBoolean("canGoForward", webView.canGoForward());
|
|
256
299
|
event.putDouble("progress", (float) newProgress / 100);
|
|
257
300
|
|
|
258
|
-
|
|
301
|
+
UIManagerHelper.getEventDispatcherForReactTag(this.mWebView.getThemedReactContext(), reactTag).dispatchEvent(new TopLoadingProgressEvent(reactTag, event));
|
|
302
|
+
|
|
259
303
|
}
|
|
260
304
|
|
|
261
305
|
@Override
|