react-native-webview-bootpay 13.6.1 → 13.8.2
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/build.gradle +35 -10
- package/android/gradle.properties +42 -0
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebChromeClient.java +16 -3
- package/android/src/main/java/kr/co/bootpay/webview/BPCWebviewWrapper.kt +39 -0
- package/apple/BPCWebView.h +6 -0
- package/apple/BPCWebView.mm +36 -27
- package/apple/BPCWebViewImpl.h +1 -0
- package/apple/BPCWebViewImpl.m +25 -0
- package/apple/BPCWebViewManager.mm +1 -0
- package/lib/BPCWebViewNativeComponent.d.ts +13 -12
- package/lib/BPCWebViewNativeComponent.d.ts.map +1 -1
- package/lib/BPCWebViewNativeComponent.js +1 -6
- package/lib/NativeBPCWebView.d.ts +1 -0
- package/lib/NativeBPCWebView.d.ts.map +1 -1
- package/lib/NativeBPCWebView.js +1 -2
- package/lib/WebView.android.js +1 -136
- package/lib/WebView.d.ts +1 -1
- package/lib/WebView.d.ts.map +1 -1
- package/lib/WebView.ios.js +1 -170
- package/lib/WebView.js +1 -11
- package/lib/WebView.macos.js +1 -132
- package/lib/WebView.styles.js +1 -33
- package/lib/WebView.windows.js +1 -140
- package/lib/WebViewNativeComponent.macos.js +1 -3
- package/lib/WebViewNativeComponent.windows.js +1 -3
- package/lib/WebViewShared.d.ts +3 -3
- package/lib/WebViewShared.d.ts.map +1 -1
- package/lib/WebViewShared.js +1 -150
- package/lib/WebViewTypes.d.ts +28 -28
- package/lib/WebViewTypes.d.ts.map +1 -1
- package/lib/WebViewTypes.js +1 -33
- package/lib/index.js +1 -3
- package/package.json +28 -30
- package/react-native-webview-bootpay.podspec +26 -18
- package/react-native.config.js +9 -12
package/android/build.gradle
CHANGED
|
@@ -15,7 +15,7 @@ buildscript {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
def getExtOrIntegerDefault(prop) {
|
|
18
|
-
return rootProject.ext.has(prop) ? rootProject.ext.get(prop) : (project.properties['
|
|
18
|
+
return rootProject.ext.has(prop) ? rootProject.ext.get(prop) : (project.properties['ReactNativeWebViewBootpay_' + prop]).toInteger()
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
static def findNodeModulePath(baseDir, packageName) {
|
|
@@ -36,6 +36,18 @@ def isNewArchitectureEnabled() {
|
|
|
36
36
|
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
def supportsNamespace() {
|
|
40
|
+
def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')
|
|
41
|
+
def major = parsed[0].toInteger()
|
|
42
|
+
def minor = parsed[1].toInteger()
|
|
43
|
+
|
|
44
|
+
// Namespace support was added in 7.3.0
|
|
45
|
+
if (major == 7 && minor >= 3) {
|
|
46
|
+
return true
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return major >= 8
|
|
50
|
+
}
|
|
39
51
|
|
|
40
52
|
apply plugin: 'com.android.library'
|
|
41
53
|
if (isNewArchitectureEnabled()) {
|
|
@@ -44,6 +56,19 @@ if (isNewArchitectureEnabled()) {
|
|
|
44
56
|
apply plugin: 'kotlin-android'
|
|
45
57
|
|
|
46
58
|
android {
|
|
59
|
+
if (supportsNamespace()) {
|
|
60
|
+
namespace "kr.co.bootpay.webview"
|
|
61
|
+
buildFeatures {
|
|
62
|
+
buildConfig true
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
sourceSets {
|
|
66
|
+
main {
|
|
67
|
+
manifest.srcFile "src/main/AndroidManifestNew.xml"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
47
72
|
compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
|
|
48
73
|
|
|
49
74
|
defaultConfig {
|
|
@@ -84,12 +109,12 @@ dependencies {
|
|
|
84
109
|
implementation "androidx.webkit:webkit:${safeExtGet('webkitVersion')}"
|
|
85
110
|
}
|
|
86
111
|
|
|
87
|
-
if (isNewArchitectureEnabled()) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
}
|
|
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,3 +3,45 @@ ReactNativeWebView_webkitVersion=1.4.0
|
|
|
3
3
|
ReactNativeWebView_compileSdkVersion=31
|
|
4
4
|
ReactNativeWebView_targetSdkVersion=31
|
|
5
5
|
ReactNativeWebView_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
|
|
@@ -3,11 +3,14 @@ package kr.co.bootpay.webview;
|
|
|
3
3
|
import android.Manifest;
|
|
4
4
|
import android.annotation.TargetApi;
|
|
5
5
|
import android.app.Activity;
|
|
6
|
+
import android.app.AlertDialog;
|
|
6
7
|
import android.content.pm.PackageManager;
|
|
7
8
|
import android.net.Uri;
|
|
9
|
+
import android.net.http.SslError;
|
|
8
10
|
import android.os.Build;
|
|
9
11
|
import android.os.Message;
|
|
10
12
|
import android.view.Gravity;
|
|
13
|
+
import android.view.KeyEvent;
|
|
11
14
|
import android.view.View;
|
|
12
15
|
import android.view.ViewGroup;
|
|
13
16
|
import android.view.WindowManager;
|
|
@@ -15,12 +18,18 @@ import android.view.WindowManager;
|
|
|
15
18
|
import android.webkit.ConsoleMessage;
|
|
16
19
|
import android.webkit.GeolocationPermissions;
|
|
17
20
|
import android.webkit.PermissionRequest;
|
|
21
|
+
import android.webkit.SslErrorHandler;
|
|
18
22
|
import android.webkit.ValueCallback;
|
|
19
23
|
import android.webkit.WebChromeClient;
|
|
20
24
|
import android.webkit.WebView;
|
|
21
25
|
import android.webkit.WebViewClient;
|
|
22
26
|
import android.widget.FrameLayout;
|
|
23
27
|
|
|
28
|
+
import android.app.AlertDialog;
|
|
29
|
+
import android.content.Intent;
|
|
30
|
+
import android.annotation.SuppressLint;
|
|
31
|
+
import android.net.http.SslError;
|
|
32
|
+
|
|
24
33
|
import androidx.annotation.RequiresApi;
|
|
25
34
|
import androidx.core.content.ContextCompat;
|
|
26
35
|
|
|
@@ -44,6 +53,10 @@ import java.util.List;
|
|
|
44
53
|
import android.app.Dialog;
|
|
45
54
|
import android.content.Context;
|
|
46
55
|
import android.content.Intent;
|
|
56
|
+
import android.widget.Toast;
|
|
57
|
+
|
|
58
|
+
import org.json.JSONException;
|
|
59
|
+
import org.json.JSONObject;
|
|
47
60
|
|
|
48
61
|
public class BPCWebChromeClient extends WebChromeClient implements LifecycleEventListener {
|
|
49
62
|
protected static final FrameLayout.LayoutParams FULLSCREEN_LAYOUT_PARAMS = new FrameLayout.LayoutParams(
|
|
@@ -231,15 +244,15 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
231
244
|
if (progressChangedFilter.isWaitingForCommandLoadUrl()) {
|
|
232
245
|
return;
|
|
233
246
|
}
|
|
247
|
+
int reactTag = BPCWebViewWrapper.getReactTagFromWebView(webView);
|
|
234
248
|
WritableMap event = Arguments.createMap();
|
|
235
|
-
event.putDouble("target",
|
|
249
|
+
event.putDouble("target", reactTag);
|
|
236
250
|
event.putString("title", webView.getTitle());
|
|
237
251
|
event.putString("url", url);
|
|
238
252
|
event.putBoolean("canGoBack", webView.canGoBack());
|
|
239
253
|
event.putBoolean("canGoForward", webView.canGoForward());
|
|
240
254
|
event.putDouble("progress", (float) newProgress / 100);
|
|
241
255
|
|
|
242
|
-
int reactTag = webView.getId();
|
|
243
256
|
UIManagerHelper.getEventDispatcherForReactTag(this.mWebView.getThemedReactContext(), reactTag).dispatchEvent(new TopLoadingProgressEvent(reactTag, event));
|
|
244
257
|
}
|
|
245
258
|
|
|
@@ -265,7 +278,7 @@ public class BPCWebChromeClient extends WebChromeClient implements LifecycleEven
|
|
|
265
278
|
*
|
|
266
279
|
* Try to ask user to grant permission using Activity.requestPermissions
|
|
267
280
|
*
|
|
268
|
-
* Find more details here: https://github.com/react-native-webview
|
|
281
|
+
* Find more details here: https://github.com/react-native-webview/react-native-webview/pull/2732
|
|
269
282
|
*/
|
|
270
283
|
androidPermission = PermissionRequest.RESOURCE_PROTECTED_MEDIA_ID;
|
|
271
284
|
} }
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
package kr.co.bootpay.webview
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.graphics.Color
|
|
5
|
+
import android.view.View
|
|
6
|
+
import android.webkit.WebView
|
|
7
|
+
import android.widget.FrameLayout
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A [FrameLayout] container to hold the [BPCWebView].
|
|
11
|
+
* We need this to prevent WebView crash when the WebView is out of viewport and
|
|
12
|
+
* [com.facebook.react.views.view.ReactViewGroup] clips the canvas.
|
|
13
|
+
* The WebView will then create an empty offscreen surface and NPE.
|
|
14
|
+
*/
|
|
15
|
+
class BPCWebViewWrapper(context: Context, webView: BPCWebView) : FrameLayout(context) {
|
|
16
|
+
init {
|
|
17
|
+
// We make the WebView as transparent on top of the container,
|
|
18
|
+
// and let React Native sets background color for the container.
|
|
19
|
+
webView.setBackgroundColor(Color.TRANSPARENT)
|
|
20
|
+
addView(webView)
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
val webView: BPCWebView = getChildAt(0) as BPCWebView
|
|
24
|
+
|
|
25
|
+
companion object {
|
|
26
|
+
/**
|
|
27
|
+
* A helper to get react tag id by given WebView
|
|
28
|
+
*/
|
|
29
|
+
@JvmStatic
|
|
30
|
+
fun getReactTagFromWebView(webView: WebView): Int {
|
|
31
|
+
// It is expected that the webView is enclosed by [BPCWebViewWrapper] as the first child.
|
|
32
|
+
// Therefore, it must have a parent, and the parent ID is the reactTag.
|
|
33
|
+
// In exceptional cases, such as receiving WebView messaging after the view has been unmounted,
|
|
34
|
+
// the WebView will not have a parent.
|
|
35
|
+
// In this case, we simply return -1 to indicate that it was not found.
|
|
36
|
+
return (webView.parent as? View)?.id ?: -1
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
package/apple/BPCWebView.h
CHANGED
|
@@ -3,7 +3,13 @@
|
|
|
3
3
|
#import <React/RCTViewComponentView.h>
|
|
4
4
|
#import <React/RCTConversions.h>
|
|
5
5
|
#import <WebKit/WKDataDetectorTypes.h>
|
|
6
|
+
|
|
7
|
+
#if !TARGET_OS_OSX
|
|
6
8
|
#import <UIKit/UIKit.h>
|
|
9
|
+
#else
|
|
10
|
+
#import <React/RCTUIKit.h>
|
|
11
|
+
#endif // !TARGET_OS_OSX
|
|
12
|
+
|
|
7
13
|
#import <react/renderer/components/BPCWebViewSpec/Props.h>
|
|
8
14
|
|
|
9
15
|
#ifndef NativeComponentExampleComponentView_h
|
package/apple/BPCWebView.mm
CHANGED
|
@@ -74,10 +74,10 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
74
74
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
75
75
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
76
76
|
.navigationType = stringToOnShouldStartLoadWithRequestNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
|
|
77
|
-
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
78
|
-
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
79
|
-
.isTopFrame = [[dictionary valueForKey:@"isTopFrame"] boolValue],
|
|
80
|
-
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
77
|
+
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
78
|
+
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
79
|
+
.isTopFrame = static_cast<bool>([[dictionary valueForKey:@"isTopFrame"] boolValue]),
|
|
80
|
+
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
|
|
81
81
|
.mainDocumentURL = std::string([[dictionary valueForKey:@"mainDocumentURL"] UTF8String])
|
|
82
82
|
};
|
|
83
83
|
webViewEventEmitter->onShouldStartLoadWithRequest(data);
|
|
@@ -91,9 +91,9 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
91
91
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
92
92
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
93
93
|
.navigationType = stringToOnLoadingStartNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String])),
|
|
94
|
-
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
95
|
-
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
96
|
-
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
94
|
+
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
95
|
+
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
96
|
+
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
|
|
97
97
|
.mainDocumentURL = std::string([[dictionary valueForKey:@"mainDocumentURL"] UTF8String], [[dictionary valueForKey:@"mainDocumentURL"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])
|
|
98
98
|
};
|
|
99
99
|
webViewEventEmitter->onLoadingStart(data);
|
|
@@ -108,9 +108,9 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
108
108
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
109
109
|
.code = [[dictionary valueForKey:@"code"] intValue],
|
|
110
110
|
.description = std::string([[dictionary valueForKey:@"description"] UTF8String]),
|
|
111
|
-
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
112
|
-
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
113
|
-
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
111
|
+
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
112
|
+
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
113
|
+
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
|
|
114
114
|
.domain = std::string([[dictionary valueForKey:@"domain"] UTF8String])
|
|
115
115
|
};
|
|
116
116
|
webViewEventEmitter->onLoadingError(data);
|
|
@@ -123,9 +123,9 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
123
123
|
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
124
124
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
125
125
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
126
|
-
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
127
|
-
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
128
|
-
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
126
|
+
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
127
|
+
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
128
|
+
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
|
|
129
129
|
.data = std::string([[dictionary valueForKey:@"data"] UTF8String])
|
|
130
130
|
};
|
|
131
131
|
webViewEventEmitter->onMessage(data);
|
|
@@ -139,9 +139,9 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
139
139
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
140
140
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
141
141
|
.navigationType = stringToOnLoadingFinishNavigationTypeEnum(std::string([[dictionary valueForKey:@"navigationType"] UTF8String], [[dictionary valueForKey:@"navigationType"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])),
|
|
142
|
-
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
143
|
-
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
144
|
-
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
142
|
+
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
143
|
+
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
144
|
+
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
|
|
145
145
|
.mainDocumentURL = std::string([[dictionary valueForKey:@"mainDocumentURL"] UTF8String], [[dictionary valueForKey:@"mainDocumentURL"] lengthOfBytesUsingEncoding:NSUTF8StringEncoding])
|
|
146
146
|
};
|
|
147
147
|
webViewEventEmitter->onLoadingFinish(data);
|
|
@@ -154,9 +154,9 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
154
154
|
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
155
155
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
156
156
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
157
|
-
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
158
|
-
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
159
|
-
.loading = [[dictionary valueForKey:@"loading"] boolValue],
|
|
157
|
+
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
158
|
+
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
159
|
+
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue]),
|
|
160
160
|
.progress = [[dictionary valueForKey:@"progress"] doubleValue]
|
|
161
161
|
};
|
|
162
162
|
webViewEventEmitter->onLoadingProgress(data);
|
|
@@ -169,9 +169,9 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
169
169
|
.url = std::string([[dictionary valueForKey:@"url"] UTF8String]),
|
|
170
170
|
.lockIdentifier = [[dictionary valueForKey:@"lockIdentifier"] doubleValue],
|
|
171
171
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
172
|
-
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
173
|
-
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
174
|
-
.loading = [[dictionary valueForKey:@"loading"] boolValue]
|
|
172
|
+
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
173
|
+
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
174
|
+
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue])
|
|
175
175
|
};
|
|
176
176
|
webViewEventEmitter->onContentProcessDidTerminate(data);
|
|
177
177
|
}
|
|
@@ -229,9 +229,9 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
229
229
|
.title = std::string([[dictionary valueForKey:@"title"] UTF8String]),
|
|
230
230
|
.statusCode = [[dictionary valueForKey:@"statusCode"] intValue],
|
|
231
231
|
.description = std::string([[dictionary valueForKey:@"description"] UTF8String]),
|
|
232
|
-
.canGoBack = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
233
|
-
.canGoForward = [[dictionary valueForKey:@"canGoBack"] boolValue],
|
|
234
|
-
.loading = [[dictionary valueForKey:@"loading"] boolValue]
|
|
232
|
+
.canGoBack = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
233
|
+
.canGoForward = static_cast<bool>([[dictionary valueForKey:@"canGoBack"] boolValue]),
|
|
234
|
+
.loading = static_cast<bool>([[dictionary valueForKey:@"loading"] boolValue])
|
|
235
235
|
};
|
|
236
236
|
webViewEventEmitter->onHttpError(data);
|
|
237
237
|
}
|
|
@@ -266,6 +266,7 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
266
266
|
REMAP_WEBVIEW_STRING_PROP(injectedJavaScriptBeforeContentLoaded)
|
|
267
267
|
REMAP_WEBVIEW_PROP(injectedJavaScriptForMainFrameOnly)
|
|
268
268
|
REMAP_WEBVIEW_PROP(injectedJavaScriptBeforeContentLoadedForMainFrameOnly)
|
|
269
|
+
REMAP_WEBVIEW_STRING_PROP(injectedJavaScriptObject)
|
|
269
270
|
REMAP_WEBVIEW_PROP(javaScriptEnabled)
|
|
270
271
|
REMAP_WEBVIEW_PROP(javaScriptCanOpenWindowsAutomatically)
|
|
271
272
|
REMAP_WEBVIEW_PROP(allowFileAccessFromFileURLs)
|
|
@@ -284,9 +285,10 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
284
285
|
REMAP_WEBVIEW_PROP(cacheEnabled)
|
|
285
286
|
REMAP_WEBVIEW_PROP(allowsLinkPreview)
|
|
286
287
|
REMAP_WEBVIEW_STRING_PROP(allowingReadAccessToURL)
|
|
287
|
-
|
|
288
288
|
REMAP_WEBVIEW_PROP(messagingEnabled)
|
|
289
|
+
#if !TARGET_OS_OSX
|
|
289
290
|
REMAP_WEBVIEW_PROP(fraudulentWebsiteWarningEnabled)
|
|
291
|
+
#endif // !TARGET_OS_OSX
|
|
290
292
|
REMAP_WEBVIEW_PROP(enableApplePay)
|
|
291
293
|
REMAP_WEBVIEW_PROP(pullToRefreshEnabled)
|
|
292
294
|
REMAP_WEBVIEW_PROP(bounces)
|
|
@@ -310,7 +312,8 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
310
312
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140500 /* iOS 14.5 */
|
|
311
313
|
REMAP_WEBVIEW_PROP(textInteractionEnabled)
|
|
312
314
|
#endif
|
|
313
|
-
|
|
315
|
+
|
|
316
|
+
#if !TARGET_OS_OSX
|
|
314
317
|
if (oldViewProps.dataDetectorTypes != newViewProps.dataDetectorTypes) {
|
|
315
318
|
WKDataDetectorTypes dataDetectorTypes = WKDataDetectorTypeNone;
|
|
316
319
|
if (dataDetectorTypes & BPCWebViewDataDetectorTypes::Address) {
|
|
@@ -334,6 +337,8 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
334
337
|
}
|
|
335
338
|
[_view setDataDetectorTypes:dataDetectorTypes];
|
|
336
339
|
}
|
|
340
|
+
#endif // !TARGET_OS_OSX
|
|
341
|
+
|
|
337
342
|
if (oldViewProps.contentInset.top != newViewProps.contentInset.top || oldViewProps.contentInset.left != newViewProps.contentInset.left || oldViewProps.contentInset.right != newViewProps.contentInset.right || oldViewProps.contentInset.bottom != newViewProps.contentInset.bottom) {
|
|
338
343
|
UIEdgeInsets edgesInsets = {
|
|
339
344
|
.top = newViewProps.contentInset.top,
|
|
@@ -350,6 +355,8 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
350
355
|
@"password": RCTNSStringFromString(newViewProps.basicAuthCredential.password)
|
|
351
356
|
}];
|
|
352
357
|
}
|
|
358
|
+
|
|
359
|
+
#if !TARGET_OS_OSX
|
|
353
360
|
if (oldViewProps.contentInsetAdjustmentBehavior != newViewProps.contentInsetAdjustmentBehavior) {
|
|
354
361
|
if (newViewProps.contentInsetAdjustmentBehavior == BPCWebViewContentInsetAdjustmentBehavior::Never) {
|
|
355
362
|
[_view setContentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentNever];
|
|
@@ -361,6 +368,7 @@ auto stringToOnLoadingFinishNavigationTypeEnum(std::string value) {
|
|
|
361
368
|
[_view setContentInsetAdjustmentBehavior: UIScrollViewContentInsetAdjustmentAlways];
|
|
362
369
|
}
|
|
363
370
|
}
|
|
371
|
+
#endif // !TARGET_OS_OSX
|
|
364
372
|
|
|
365
373
|
if (oldViewProps.menuItems != newViewProps.menuItems) {
|
|
366
374
|
NSMutableArray *newMenuItems = [NSMutableArray array];
|
|
@@ -526,3 +534,4 @@ Class<RCTComponentViewProtocol> BPCWebViewCls(void)
|
|
|
526
534
|
|
|
527
535
|
@end
|
|
528
536
|
#endif
|
|
537
|
+
|
package/apple/BPCWebViewImpl.h
CHANGED
|
@@ -65,6 +65,7 @@ shouldStartLoadForRequest:(NSMutableDictionary<NSString *, id> *)request
|
|
|
65
65
|
@property (nonatomic, copy) NSString * _Nullable injectedJavaScriptBeforeContentLoaded;
|
|
66
66
|
@property (nonatomic, assign) BOOL injectedJavaScriptForMainFrameOnly;
|
|
67
67
|
@property (nonatomic, assign) BOOL injectedJavaScriptBeforeContentLoadedForMainFrameOnly;
|
|
68
|
+
@property (nonatomic, copy) NSString * _Nullable injectedJavaScriptObject;
|
|
68
69
|
@property (nonatomic, assign) BOOL scrollEnabled;
|
|
69
70
|
@property (nonatomic, assign) BOOL sharedCookiesEnabled;
|
|
70
71
|
@property (nonatomic, assign) BOOL autoManageStatusBarEnabled;
|
package/apple/BPCWebViewImpl.m
CHANGED
|
@@ -122,6 +122,7 @@ RCTAutoInsetsProtocol>
|
|
|
122
122
|
|
|
123
123
|
@property (nonatomic, copy) BPCWKWebView *webView;
|
|
124
124
|
@property (nonatomic, strong) WKUserScript *postMessageScript;
|
|
125
|
+
@property (nonatomic, strong) WKUserScript *injectedObjectJsonScript;
|
|
125
126
|
@property (nonatomic, strong) WKUserScript *atStartScript;
|
|
126
127
|
@property (nonatomic, strong) WKUserScript *atEndScript;
|
|
127
128
|
@end
|
|
@@ -1657,6 +1658,7 @@ didFinishNavigation:(WKNavigation *)navigation
|
|
|
1657
1658
|
_webView.scrollView.bounces = _pullToRefreshEnabled || bounces;
|
|
1658
1659
|
}
|
|
1659
1660
|
#endif // !TARGET_OS_OSX
|
|
1661
|
+
|
|
1660
1662
|
|
|
1661
1663
|
- (void)setInjectedJavaScript:(NSString *)source {
|
|
1662
1664
|
_injectedJavaScript = source;
|
|
@@ -1670,6 +1672,26 @@ didFinishNavigation:(WKNavigation *)navigation
|
|
|
1670
1672
|
}
|
|
1671
1673
|
}
|
|
1672
1674
|
|
|
1675
|
+
- (void)setInjectedJavaScriptObject:(NSString *)source
|
|
1676
|
+
{
|
|
1677
|
+
self.injectedObjectJsonScript = [
|
|
1678
|
+
[WKUserScript alloc]
|
|
1679
|
+
initWithSource: [
|
|
1680
|
+
NSString
|
|
1681
|
+
stringWithFormat:
|
|
1682
|
+
@"window.%@ ??= {};"
|
|
1683
|
+
"window.%@.injectedObjectJson = function () {"
|
|
1684
|
+
" return `%@`;"
|
|
1685
|
+
"};", MessageHandlerName, MessageHandlerName, source
|
|
1686
|
+
]
|
|
1687
|
+
injectionTime:WKUserScriptInjectionTimeAtDocumentStart
|
|
1688
|
+
/* 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.
|
|
1689
|
+
* I am keeping it as YES for consistency with previous behaviour. */
|
|
1690
|
+
// forMainFrameOnly:_messagingEnabledForMainFrameOnly
|
|
1691
|
+
forMainFrameOnly:YES
|
|
1692
|
+
];
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1673
1695
|
- (void)setEnableApplePay:(BOOL)enableApplePay {
|
|
1674
1696
|
_enableApplePay = enableApplePay;
|
|
1675
1697
|
if(_webView != nil){
|
|
@@ -1870,6 +1892,9 @@ didFinishNavigation:(WKNavigation *)navigation
|
|
|
1870
1892
|
if (self.atStartScript) {
|
|
1871
1893
|
[wkWebViewConfig.userContentController addUserScript:self.atStartScript];
|
|
1872
1894
|
}
|
|
1895
|
+
if (self.injectedObjectJsonScript) {
|
|
1896
|
+
[wkWebViewConfig.userContentController addUserScript:self.injectedObjectJsonScript];
|
|
1897
|
+
}
|
|
1873
1898
|
}
|
|
1874
1899
|
|
|
1875
1900
|
- (NSURLRequest *)requestForSource:(id)json {
|
|
@@ -64,6 +64,7 @@ RCT_EXPORT_VIEW_PROPERTY(injectedJavaScript, NSString)
|
|
|
64
64
|
RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptBeforeContentLoaded, NSString)
|
|
65
65
|
RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptForMainFrameOnly, BOOL)
|
|
66
66
|
RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptBeforeContentLoadedForMainFrameOnly, BOOL)
|
|
67
|
+
RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptObject, NSString)
|
|
67
68
|
RCT_EXPORT_VIEW_PROPERTY(javaScriptEnabled, BOOL)
|
|
68
69
|
RCT_EXPORT_VIEW_PROPERTY(javaScriptCanOpenWindowsAutomatically, BOOL)
|
|
69
70
|
RCT_EXPORT_VIEW_PROPERTY(allowFileAccessFromFileURLs, BOOL)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
/// <reference types="react-native/types/modules/Codegen" />
|
|
2
3
|
import type { HostComponent, ViewProps } from 'react-native';
|
|
3
4
|
import { DirectEventHandler, Double, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
|
-
export
|
|
5
|
+
export type WebViewNativeEvent = Readonly<{
|
|
5
6
|
url: string;
|
|
6
7
|
loading: boolean;
|
|
7
8
|
title: string;
|
|
@@ -9,12 +10,12 @@ export declare type WebViewNativeEvent = Readonly<{
|
|
|
9
10
|
canGoForward: boolean;
|
|
10
11
|
lockIdentifier: Double;
|
|
11
12
|
}>;
|
|
12
|
-
export
|
|
13
|
+
export type WebViewCustomMenuSelectionEvent = Readonly<{
|
|
13
14
|
label: string;
|
|
14
15
|
key: string;
|
|
15
16
|
selectedText: string;
|
|
16
17
|
}>;
|
|
17
|
-
export
|
|
18
|
+
export type WebViewMessageEvent = Readonly<{
|
|
18
19
|
url: string;
|
|
19
20
|
loading: boolean;
|
|
20
21
|
title: string;
|
|
@@ -23,10 +24,10 @@ export declare type WebViewMessageEvent = Readonly<{
|
|
|
23
24
|
lockIdentifier: Double;
|
|
24
25
|
data: string;
|
|
25
26
|
}>;
|
|
26
|
-
export
|
|
27
|
+
export type WebViewOpenWindowEvent = Readonly<{
|
|
27
28
|
targetUrl: string;
|
|
28
29
|
}>;
|
|
29
|
-
export
|
|
30
|
+
export type WebViewHttpErrorEvent = Readonly<{
|
|
30
31
|
url: string;
|
|
31
32
|
loading: boolean;
|
|
32
33
|
title: string;
|
|
@@ -36,7 +37,7 @@ export declare type WebViewHttpErrorEvent = Readonly<{
|
|
|
36
37
|
description: string;
|
|
37
38
|
statusCode: Int32;
|
|
38
39
|
}>;
|
|
39
|
-
export
|
|
40
|
+
export type WebViewErrorEvent = Readonly<{
|
|
40
41
|
url: string;
|
|
41
42
|
loading: boolean;
|
|
42
43
|
title: string;
|
|
@@ -47,7 +48,7 @@ export declare type WebViewErrorEvent = Readonly<{
|
|
|
47
48
|
code: Int32;
|
|
48
49
|
description: string;
|
|
49
50
|
}>;
|
|
50
|
-
export
|
|
51
|
+
export type WebViewNativeProgressEvent = Readonly<{
|
|
51
52
|
url: string;
|
|
52
53
|
loading: boolean;
|
|
53
54
|
title: string;
|
|
@@ -56,7 +57,7 @@ export declare type WebViewNativeProgressEvent = Readonly<{
|
|
|
56
57
|
lockIdentifier: Double;
|
|
57
58
|
progress: Double;
|
|
58
59
|
}>;
|
|
59
|
-
export
|
|
60
|
+
export type WebViewNavigationEvent = Readonly<{
|
|
60
61
|
url: string;
|
|
61
62
|
loading: boolean;
|
|
62
63
|
title: string;
|
|
@@ -66,7 +67,7 @@ export declare type WebViewNavigationEvent = Readonly<{
|
|
|
66
67
|
navigationType: 'click' | 'formsubmit' | 'backforward' | 'reload' | 'formresubmit' | 'other';
|
|
67
68
|
mainDocumentURL?: string;
|
|
68
69
|
}>;
|
|
69
|
-
export
|
|
70
|
+
export type ShouldStartLoadRequestEvent = Readonly<{
|
|
70
71
|
url: string;
|
|
71
72
|
loading: boolean;
|
|
72
73
|
title: string;
|
|
@@ -77,7 +78,7 @@ export declare type ShouldStartLoadRequestEvent = Readonly<{
|
|
|
77
78
|
mainDocumentURL?: string;
|
|
78
79
|
isTopFrame: boolean;
|
|
79
80
|
}>;
|
|
80
|
-
|
|
81
|
+
type ScrollEvent = Readonly<{
|
|
81
82
|
contentInset: {
|
|
82
83
|
bottom: Double;
|
|
83
84
|
left: Double;
|
|
@@ -107,10 +108,10 @@ declare type ScrollEvent = Readonly<{
|
|
|
107
108
|
zoomScale?: Double;
|
|
108
109
|
responderIgnoreScroll?: boolean;
|
|
109
110
|
}>;
|
|
110
|
-
|
|
111
|
+
type WebViewRenderProcessGoneEvent = Readonly<{
|
|
111
112
|
didCrash: boolean;
|
|
112
113
|
}>;
|
|
113
|
-
|
|
114
|
+
type WebViewDownloadEvent = Readonly<{
|
|
114
115
|
downloadUrl: string;
|
|
115
116
|
}>;
|
|
116
117
|
export interface NativeProps extends ViewProps {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BPCWebViewNativeComponent.d.ts","sourceRoot":"","sources":["../src/BPCWebViewNativeComponent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"BPCWebViewNativeComponent.d.ts","sourceRoot":"","sources":["../src/BPCWebViewNativeComponent.ts"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAC,kBAAkB,EAAC,MAAM,EAAE,KAAK,EAAE,WAAW,EAAC,MAAM,2CAA2C,CAAC;AAGxG,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC;IACxC,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK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Aa,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACtG,YAAY,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;IAC9E,WAAW,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAE3F,OAAO,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACtF,aAAa,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;IAC/E,UAAU,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,EAAE,gBAAgB,EAAE,OAAO,KAAK,IAAI,CAAC;IACvG,YAAY,EAAE,CAAC,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,WAAW,CAAC,CAAC,KAAK,IAAI,CAAC;CAE/E;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;;AAEH,wBAEgC"}
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
3
|
-
export var Commands = codegenNativeCommands({
|
|
4
|
-
supportedCommands: ['goBack', 'goForward', 'reload', 'stopLoading', 'injectJavaScript', 'requestFocus', 'postMessage', 'loadUrl', 'clearFormData', 'clearCache', 'clearHistory']
|
|
5
|
-
});
|
|
6
|
-
export default codegenNativeComponent('BPCWebView');
|
|
1
|
+
var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.__INTERNAL_VIEW_CONFIG=exports.Commands=void 0;var _codegenNativeComponent=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));var _codegenNativeCommands=_interopRequireDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));var NativeComponentRegistry=require('react-native/Libraries/NativeComponent/NativeComponentRegistry');var _require=require('react-native/Libraries/NativeComponent/ViewConfigIgnore'),ConditionallyIgnoredEventHandlers=_require.ConditionallyIgnoredEventHandlers;var _require2=require("react-native/Libraries/ReactNative/RendererProxy"),dispatchCommand=_require2.dispatchCommand;var nativeComponentName='BPCWebView';var __INTERNAL_VIEW_CONFIG=exports.__INTERNAL_VIEW_CONFIG={uiViewClassName:'BPCWebView',directEventTypes:{topContentSizeChange:{registrationName:'onContentSizeChange'},topRenderProcessGone:{registrationName:'onRenderProcessGone'},topContentProcessDidTerminate:{registrationName:'onContentProcessDidTerminate'},topCustomMenuSelection:{registrationName:'onCustomMenuSelection'},topFileDownload:{registrationName:'onFileDownload'},topLoadingError:{registrationName:'onLoadingError'},topLoadingFinish:{registrationName:'onLoadingFinish'},topLoadingProgress:{registrationName:'onLoadingProgress'},topLoadingStart:{registrationName:'onLoadingStart'},topHttpError:{registrationName:'onHttpError'},topMessage:{registrationName:'onMessage'},topOpenWindow:{registrationName:'onOpenWindow'},topScroll:{registrationName:'onScroll'},topShouldStartLoadWithRequest:{registrationName:'onShouldStartLoadWithRequest'}},validAttributes:Object.assign({allowFileAccess:true,allowsProtectedMedia:true,allowsFullscreenVideo:true,androidLayerType:true,cacheMode:true,domStorageEnabled:true,downloadingMessage:true,forceDarkOn:true,geolocationEnabled:true,lackPermissionToDownloadMessage:true,messagingModuleName:true,minimumFontSize:true,mixedContentMode:true,nestedScrollEnabled:true,overScrollMode:true,saveFormDataDisabled:true,scalesPageToFit:true,setBuiltInZoomControls:true,setDisplayZoomControls:true,setSupportMultipleWindows:true,textZoom:true,thirdPartyCookiesEnabled:true,hasOnScroll:true,injectedJavaScriptObject:true,allowingReadAccessToURL:true,allowsBackForwardNavigationGestures:true,allowsInlineMediaPlayback:true,allowsAirPlayForMediaPlayback:true,allowsLinkPreview:true,automaticallyAdjustContentInsets:true,autoManageStatusBarEnabled:true,bounces:true,contentInset:true,contentInsetAdjustmentBehavior:true,contentMode:true,dataDetectorTypes:true,decelerationRate:true,directionalLockEnabled:true,enableApplePay:true,hideKeyboardAccessoryView:true,keyboardDisplayRequiresUserAction:true,limitsNavigationsToAppBoundDomains:true,mediaCapturePermissionGrantType:true,pagingEnabled:true,pullToRefreshEnabled:true,scrollEnabled:true,sharedCookiesEnabled:true,textInteractionEnabled:true,useSharedProcessPool:true,menuItems:true,suppressMenuItems:true,hasOnFileDownload:true,fraudulentWebsiteWarningEnabled:true,allowFileAccessFromFileURLs:true,allowUniversalAccessFromFileURLs:true,applicationNameForUserAgent:true,basicAuthCredential:true,cacheEnabled:true,incognito:true,injectedJavaScript:true,injectedJavaScriptBeforeContentLoaded:true,injectedJavaScriptForMainFrameOnly:true,injectedJavaScriptBeforeContentLoadedForMainFrameOnly:true,javaScriptCanOpenWindowsAutomatically:true,javaScriptEnabled:true,webviewDebuggingEnabled:true,mediaPlaybackRequiresUserAction:true,messagingEnabled:true,hasOnOpenWindowEvent:true,showsHorizontalScrollIndicator:true,showsVerticalScrollIndicator:true,newSource:true,userAgent:true},ConditionallyIgnoredEventHandlers({onContentSizeChange:true,onRenderProcessGone:true,onContentProcessDidTerminate:true,onCustomMenuSelection:true,onFileDownload:true,onLoadingError:true,onLoadingFinish:true,onLoadingProgress:true,onLoadingStart:true,onHttpError:true,onMessage:true,onOpenWindow:true,onScroll:true,onShouldStartLoadWithRequest:true}))};var _default=exports.default=NativeComponentRegistry.get(nativeComponentName,function(){return __INTERNAL_VIEW_CONFIG;});var Commands=exports.Commands={goBack:function goBack(ref){dispatchCommand(ref,"goBack",[]);},goForward:function goForward(ref){dispatchCommand(ref,"goForward",[]);},reload:function reload(ref){dispatchCommand(ref,"reload",[]);},stopLoading:function stopLoading(ref){dispatchCommand(ref,"stopLoading",[]);},injectJavaScript:function injectJavaScript(ref,javascript){dispatchCommand(ref,"injectJavaScript",[javascript]);},requestFocus:function requestFocus(ref){dispatchCommand(ref,"requestFocus",[]);},postMessage:function postMessage(ref,data){dispatchCommand(ref,"postMessage",[data]);},loadUrl:function loadUrl(ref,url){dispatchCommand(ref,"loadUrl",[url]);},clearFormData:function clearFormData(ref){dispatchCommand(ref,"clearFormData",[]);},clearCache:function clearCache(ref,includeDiskFiles){dispatchCommand(ref,"clearCache",[includeDiskFiles]);},clearHistory:function clearHistory(ref){dispatchCommand(ref,"clearHistory",[]);}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NativeBPCWebView.d.ts","sourceRoot":"","sources":["../src/NativeBPCWebView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAC,KAAK,EAAC,MAAM,2CAA2C,CAAC;AAEhE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAGhC,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,iCAAiC,CAAC,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,GAAG,IAAI,CAAC;CACtF;;AAED,wBAAoE"}
|
|
1
|
+
{"version":3,"file":"NativeBPCWebView.d.ts","sourceRoot":"","sources":["../src/NativeBPCWebView.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEhD,OAAO,EAAC,KAAK,EAAC,MAAM,2CAA2C,CAAC;AAEhE,MAAM,WAAW,IAAK,SAAQ,WAAW;IACvC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,CAAC;IAGhC,qBAAqB,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,iCAAiC,CAAC,WAAW,EAAE,OAAO,EAAE,cAAc,EAAE,KAAK,GAAG,IAAI,CAAC;CACtF;;AAED,wBAAoE"}
|