@exodus/react-native-webview 11.26.1-exodus.33 → 11.26.1-exodus.34
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/src/main/java/com/reactnativecommunity/webview/RNCWebViewManager.java +14 -16
- package/apple/RNCWebView.m +8 -16
- package/apple/RNCWebViewManager.m +1 -1
- package/lib/WebView.android.js +3 -3
- package/lib/WebView.ios.js +3 -3
- package/lib/WebViewShared.d.ts +0 -1
- package/lib/WebViewShared.js +0 -3
- package/lib/WebViewTypes.d.ts +2 -2
- package/package.json +1 -1
- package/android/build/.transforms/bd1c9282aaabf4a0d1b6bb39aff484a4/results.bin +0 -1
- package/android/build/.transforms/bd1c9282aaabf4a0d1b6bb39aff484a4/transformed/classes/classes.dex +0 -0
- package/android/build/generated/source/buildConfig/debug/com/reactnativecommunity/webview/BuildConfig.java +0 -10
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml +0 -27
- package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json +0 -18
- package/android/build/intermediates/aar_metadata/debug/aar-metadata.properties +0 -4
- package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json +0 -1
- package/android/build/intermediates/compile_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/compile_r_class_jar/debug/R.jar +0 -0
- package/android/build/intermediates/compile_symbol_list/debug/R.txt +0 -1861
- package/android/build/intermediates/compiled_local_resources/debug/out/xml_file_provider_paths.xml.flat +0 -0
- package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +0 -2
- package/android/build/intermediates/incremental/debug/packageDebugResources/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugJniLibFolders/merger.xml +0 -2
- package/android/build/intermediates/incremental/mergeDebugShaders/merger.xml +0 -2
- package/android/build/intermediates/incremental/packageDebugAssets/merger.xml +0 -2
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/BasicAuthCredential.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/BuildConfig.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewFileProvider.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$RNCWebChromeClient$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$RNCWebChromeClient$2.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$RNCWebChromeClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$RNCWebView$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$RNCWebView$ProgressChangedFilter.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$RNCWebView$RNCWebViewBridge.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$RNCWebView.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager$RNCWebViewClient.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewManager.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewModule$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewModule$MimeType.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewModule$ShouldOverrideUrlLoadingLock$ShouldOverrideCallbackState.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewModule$ShouldOverrideUrlLoadingLock.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewModule.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewPackage.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewUtils$1.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/RNCWebViewUtils.class +0 -0
- package/android/build/intermediates/javac/debug/classes/com/reactnativecommunity/webview/WebViewConfig.class +0 -0
- package/android/build/intermediates/library_java_res/debug/res.jar +0 -0
- package/android/build/intermediates/local_only_symbol_list/debug/R-def.txt +0 -3
- package/android/build/intermediates/manifest_merge_blame_file/debug/manifest-merger-blame-debug-report.txt +0 -46
- package/android/build/intermediates/merged_manifest/debug/AndroidManifest.xml +0 -27
- package/android/build/intermediates/navigation_json/debug/navigation.json +0 -1
- package/android/build/intermediates/packaged_manifests/debug/output-metadata.json +0 -18
- package/android/build/intermediates/packaged_res/debug/xml/file_provider_paths.xml +0 -6
- package/android/build/intermediates/runtime_library_classes_jar/debug/classes.jar +0 -0
- package/android/build/intermediates/symbol_list_with_package_name/debug/package-aware-r.txt +0 -1381
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +0 -2
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
- package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
- package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
- package/android/build/outputs/logs/manifest-merger-debug-report.txt +0 -59
- 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/com/reactnativecommunity/webview/events/TopLoadingErrorEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopLoadingErrorEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopLoadingFinishEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopLoadingFinishEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopLoadingProgressEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopLoadingProgressEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopLoadingStartEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopLoadingStartEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopMessageEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopMessageEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopOpenWindowEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopOpenWindowEvent.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent$Companion.class +0 -0
- package/android/build/tmp/kotlin-classes/debug/com/reactnativecommunity/webview/events/TopShouldStartLoadWithRequestEvent.class +0 -0
|
@@ -226,14 +226,14 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
226
226
|
return mDownloadingMessage == null ? DEFAULT_LACK_PERMISSION_TO_DOWNLOAD_MESSAGE : mLackPermissionToDownloadMessage;
|
|
227
227
|
}
|
|
228
228
|
|
|
229
|
-
@ReactProp(name = "
|
|
230
|
-
public void
|
|
229
|
+
@ReactProp(name = "cameraPermissionOriginWhitelist")
|
|
230
|
+
public void setCameraPermissionOriginWhitelist(RNCWebView webView, ReadableArray whitelist) {
|
|
231
231
|
Set<String> whitelistSet = new HashSet<>();
|
|
232
232
|
for (int i = 0; i < whitelist.size(); i++) {
|
|
233
233
|
whitelistSet.add(whitelist.getString(i));
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
mWebChromeClient.
|
|
236
|
+
mWebChromeClient.setCameraPermissionOriginWhitelist(whitelistSet);
|
|
237
237
|
}
|
|
238
238
|
|
|
239
239
|
@ReactProp(name = "javaScriptEnabled")
|
|
@@ -1002,15 +1002,15 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
1002
1002
|
|
|
1003
1003
|
// True if protected media should be allowed, false otherwise
|
|
1004
1004
|
protected boolean mAllowsProtectedMedia = false;
|
|
1005
|
-
private Set<String>
|
|
1005
|
+
private Set<String> cameraPermissionOriginWhitelist = new HashSet<>();
|
|
1006
1006
|
|
|
1007
1007
|
public RNCWebChromeClient(ReactContext reactContext, WebView webView) {
|
|
1008
1008
|
this.mReactContext = reactContext;
|
|
1009
1009
|
this.mWebView = webView;
|
|
1010
1010
|
}
|
|
1011
1011
|
|
|
1012
|
-
public void
|
|
1013
|
-
this.
|
|
1012
|
+
public void setCameraPermissionOriginWhitelist(Set<String> whitelist) {
|
|
1013
|
+
this.cameraPermissionOriginWhitelist = whitelist;
|
|
1014
1014
|
}
|
|
1015
1015
|
|
|
1016
1016
|
@Override
|
|
@@ -1074,21 +1074,19 @@ public class RNCWebViewManager extends SimpleViewManager<WebView> {
|
|
|
1074
1074
|
grantedPermissions = new ArrayList<>();
|
|
1075
1075
|
|
|
1076
1076
|
ArrayList<String> requestedAndroidPermissions = new ArrayList<>();
|
|
1077
|
-
|
|
1078
|
-
String
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
request.deny();
|
|
1085
|
-
return;
|
|
1077
|
+
final Uri originUri = request.getOrigin();
|
|
1078
|
+
final String scheme = originUri.getScheme();
|
|
1079
|
+
final int port = originUri.getPort();
|
|
1080
|
+
String origin = scheme + "://" + originUri.getHost();
|
|
1081
|
+
|
|
1082
|
+
if (port > 0 && ((scheme == "http" && port != 80) || (scheme == "https" && port != 443))) {
|
|
1083
|
+
origin += ":" + port;
|
|
1086
1084
|
}
|
|
1087
1085
|
|
|
1088
1086
|
for (String requestedResource : request.getResources()) {
|
|
1089
1087
|
String androidPermission = null;
|
|
1090
1088
|
|
|
1091
|
-
if (this.
|
|
1089
|
+
if (this.cameraPermissionOriginWhitelist.contains(origin)) {
|
|
1092
1090
|
if (requestedResource.equals(PermissionRequest.RESOURCE_VIDEO_CAPTURE)) {
|
|
1093
1091
|
androidPermission = Manifest.permission.CAMERA;
|
|
1094
1092
|
} else if (requestedResource.equals(PermissionRequest.RESOURCE_AUDIO_CAPTURE)) {
|
package/apple/RNCWebView.m
CHANGED
|
@@ -22,7 +22,7 @@ static NSString *const HistoryShimName = @"ReactNativeHistoryShim";
|
|
|
22
22
|
static NSString *const MessageHandlerName = @"ReactNativeWebView";
|
|
23
23
|
static NSURLCredential* clientAuthenticationCredential;
|
|
24
24
|
static NSDictionary* customCertificatesForHost;
|
|
25
|
-
static NSSet *
|
|
25
|
+
static NSSet *cameraPermissionOriginWhitelist;
|
|
26
26
|
|
|
27
27
|
NSString *const CUSTOM_SELECTOR = @"_CUSTOM_SELECTOR_";
|
|
28
28
|
|
|
@@ -71,7 +71,7 @@ RCTAutoInsetsProtocol>
|
|
|
71
71
|
@property (nonatomic, strong) WKUserScript *postMessageScript;
|
|
72
72
|
@property (nonatomic, strong) WKUserScript *atStartScript;
|
|
73
73
|
@property (nonatomic, strong) WKUserScript *atEndScript;
|
|
74
|
-
@property (nonatomic, strong) NSArray<NSString *> *
|
|
74
|
+
@property (nonatomic, strong) NSArray<NSString *> *cameraPermissionOriginWhitelist;
|
|
75
75
|
@end
|
|
76
76
|
|
|
77
77
|
@implementation RNCWebView
|
|
@@ -1056,24 +1056,16 @@ RCTAutoInsetsProtocol>
|
|
|
1056
1056
|
initiatedByFrame:(WKFrameInfo *)frame
|
|
1057
1057
|
type:(WKMediaCaptureType)type
|
|
1058
1058
|
decisionHandler:(void (^)(WKPermissionDecision decision))decisionHandler {
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1059
|
+
NSString *originString = [NSString stringWithFormat:@"%@://%@", origin.protocol, origin.host];
|
|
1060
|
+
|
|
1061
|
+
if (origin.port > 0 && (([origin.protocol isEqualToString:@"http"] && origin.port != 80) || ([origin.protocol isEqualToString:@"https"] && origin.port != 443))) {
|
|
1062
|
+
originString = [originString stringByAppendingFormat:@":%ld", (long)origin.port];
|
|
1062
1063
|
}
|
|
1063
1064
|
|
|
1064
|
-
if (
|
|
1065
|
-
if ([origin.host isEqualToString:webView.URL.host]) {
|
|
1066
|
-
decisionHandler(WKPermissionDecisionGrant);
|
|
1067
|
-
} else {
|
|
1068
|
-
WKPermissionDecision decision = _mediaCapturePermissionGrantType == RNCWebViewPermissionGrantType_GrantIfSameHost_ElsePrompt ? WKPermissionDecisionPrompt : WKPermissionDecisionDeny;
|
|
1069
|
-
decisionHandler(decision);
|
|
1070
|
-
}
|
|
1071
|
-
} else if (_mediaCapturePermissionGrantType == RNCWebViewPermissionGrantType_Deny) {
|
|
1072
|
-
decisionHandler(WKPermissionDecisionDeny);
|
|
1073
|
-
} else if (_mediaCapturePermissionGrantType == RNCWebViewPermissionGrantType_Grant) {
|
|
1065
|
+
if ([self.cameraPermissionOriginWhitelist containsObject:originString]) {
|
|
1074
1066
|
decisionHandler(WKPermissionDecisionGrant);
|
|
1075
1067
|
} else {
|
|
1076
|
-
decisionHandler(
|
|
1068
|
+
decisionHandler(WKPermissionDecisionDeny);
|
|
1077
1069
|
}
|
|
1078
1070
|
}
|
|
1079
1071
|
#endif
|
|
@@ -78,7 +78,7 @@ RCT_EXPORT_VIEW_PROPERTY(pagingEnabled, BOOL)
|
|
|
78
78
|
RCT_EXPORT_VIEW_PROPERTY(cacheEnabled, BOOL)
|
|
79
79
|
RCT_EXPORT_VIEW_PROPERTY(allowsLinkPreview, BOOL)
|
|
80
80
|
RCT_EXPORT_VIEW_PROPERTY(basicAuthCredential, NSDictionary)
|
|
81
|
-
RCT_EXPORT_VIEW_PROPERTY(
|
|
81
|
+
RCT_EXPORT_VIEW_PROPERTY(cameraPermissionOriginWhitelist, NSArray)
|
|
82
82
|
|
|
83
83
|
#if defined(__IPHONE_OS_VERSION_MAX_ALLOWED) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 110000 /* __IPHONE_11_0 */
|
|
84
84
|
RCT_EXPORT_VIEW_PROPERTY(contentInsetAdjustmentBehavior, UIScrollViewContentInsetAdjustmentBehavior)
|
package/lib/WebView.android.js
CHANGED
|
@@ -5,7 +5,7 @@ import BatchedBridge from 'react-native/Libraries/BatchedBridge/BatchedBridge';
|
|
|
5
5
|
import codegenNativeCommandsUntyped from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
6
6
|
import invariant from 'invariant';
|
|
7
7
|
import RNCWebView from "./WebViewNativeComponent.android";
|
|
8
|
-
import { defaultOriginWhitelist, defaultDeeplinkWhitelist, defaultRenderError, defaultRenderLoading, useWebWiewLogic, versionPasses,
|
|
8
|
+
import { defaultOriginWhitelist, defaultDeeplinkWhitelist, defaultRenderError, defaultRenderLoading, useWebWiewLogic, versionPasses, } from './WebViewShared';
|
|
9
9
|
import styles from './WebView.styles';
|
|
10
10
|
import validateProps from './validation';
|
|
11
11
|
const { getWebViewDefaultUserAgent } = NativeModules.RNCWebViewUtils;
|
|
@@ -34,7 +34,7 @@ const mixedContentMode = 'never';
|
|
|
34
34
|
const hardMinimumChromeVersion = '100.0'; // TODO: determinime a good lower bound
|
|
35
35
|
const WebViewComponent = forwardRef((props, ref) => {
|
|
36
36
|
var _a;
|
|
37
|
-
const { overScrollMode = 'always', javaScriptEnabled = true, thirdPartyCookiesEnabled = true, scalesPageToFit = true, saveFormDataDisabled = false, cacheEnabled = true,
|
|
37
|
+
const { overScrollMode = 'always', javaScriptEnabled = true, thirdPartyCookiesEnabled = true, scalesPageToFit = true, saveFormDataDisabled = false, cacheEnabled = true, androidHardwareAccelerationDisabled = false, androidLayerType = "none", originWhitelist = defaultOriginWhitelist, deeplinkWhitelist = defaultDeeplinkWhitelist, setBuiltInZoomControls = true, setDisplayZoomControls = false, nestedScrollEnabled = false, startInLoadingState, onLoadStart, onError, onLoad, onLoadEnd, onMessage: onMessageProp, onOpenWindow: onOpenWindowProp, renderLoading, renderError, style, containerStyle, source, onShouldStartLoadWithRequest: onShouldStartLoadWithRequestProp, validateMeta, validateData, minimumChromeVersion, unsupportedVersionComponent: UnsupportedVersionComponent, ...otherProps } = validateProps(props);
|
|
38
38
|
const messagingModuleName = useRef(`WebViewMessageHandler${uniqueRef += 1}`).current;
|
|
39
39
|
const webViewRef = useRef(null);
|
|
40
40
|
const onShouldStartLoadWithRequestCallback = useCallback((shouldStart, url, lockIdentifier) => {
|
|
@@ -124,7 +124,7 @@ const WebViewComponent = forwardRef((props, ref) => {
|
|
|
124
124
|
}
|
|
125
125
|
const safeSource = (typeof source === "object" && 'uri' in source && !passesWhitelist(source.uri)) ? { uri: 'about:blank' } : source;
|
|
126
126
|
const NativeWebView = RNCWebView;
|
|
127
|
-
const webView = <NativeWebView key="webViewKey" {...otherProps}
|
|
127
|
+
const webView = <NativeWebView key="webViewKey" {...otherProps} messagingEnabled={typeof onMessageProp === 'function'} messagingModuleName={messagingModuleName} onLoadingError={onLoadingError} onLoadingFinish={onLoadingFinish} onLoadingProgress={onLoadingProgress} onLoadingStart={onLoadingStart} onMessage={onMessage} onOpenWindow={onOpenWindow} onShouldStartLoadWithRequest={onShouldStartLoadWithRequest} ref={webViewRef}
|
|
128
128
|
// TODO: find a better way to type this.
|
|
129
129
|
source={safeSource} style={webViewStyles} overScrollMode={overScrollMode} javaScriptEnabled={javaScriptEnabled} thirdPartyCookiesEnabled={thirdPartyCookiesEnabled} scalesPageToFit={scalesPageToFit} saveFormDataDisabled={saveFormDataDisabled} cacheEnabled={cacheEnabled} androidHardwareAccelerationDisabled={androidHardwareAccelerationDisabled} androidLayerType={androidLayerType} setSupportMultipleWindows={setSupportMultipleWindows} setBuiltInZoomControls={setBuiltInZoomControls} setDisplayZoomControls={setDisplayZoomControls} mixedContentMode={mixedContentMode} nestedScrollEnabled={nestedScrollEnabled} mediaPlaybackRequiresUserAction={mediaPlaybackRequiresUserAction}/>;
|
|
130
130
|
return (<View style={webViewContainerStyle}>
|
package/lib/WebView.ios.js
CHANGED
|
@@ -4,7 +4,7 @@ import invariant from 'invariant';
|
|
|
4
4
|
// @ts-expect-error react-native doesn't have this type
|
|
5
5
|
import codegenNativeCommandsUntyped from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
6
6
|
import RNCWebView from "./WebViewNativeComponent.ios";
|
|
7
|
-
import { defaultOriginWhitelist, defaultDeeplinkWhitelist, defaultRenderError, defaultRenderLoading, useWebWiewLogic, versionPasses,
|
|
7
|
+
import { defaultOriginWhitelist, defaultDeeplinkWhitelist, defaultRenderError, defaultRenderLoading, useWebWiewLogic, versionPasses, } from './WebViewShared';
|
|
8
8
|
import styles from './WebView.styles';
|
|
9
9
|
import validateProps from './validation';
|
|
10
10
|
const codegenNativeCommands = codegenNativeCommandsUntyped;
|
|
@@ -41,7 +41,7 @@ const enableApplePay = false;
|
|
|
41
41
|
const dataDetectorTypes = 'none';
|
|
42
42
|
const hardMinimumIOSVersion = '12.5.6 <13, 13.6.1 <14, 14.8.1 <15, 15.7.1';
|
|
43
43
|
const WebViewComponent = forwardRef((props, ref) => {
|
|
44
|
-
const { javaScriptEnabled = true, cacheEnabled = true,
|
|
44
|
+
const { javaScriptEnabled = true, cacheEnabled = true, originWhitelist = defaultOriginWhitelist, deeplinkWhitelist = defaultDeeplinkWhitelist, textInteractionEnabled = true, injectedJavaScript, injectedJavaScriptBeforeContentLoaded, startInLoadingState, onLoadStart, onError, onLoad, onLoadEnd, onMessage: onMessageProp, renderLoading, renderError, style, containerStyle, source, incognito, validateMeta, validateData, decelerationRate: decelerationRateProp, onShouldStartLoadWithRequest: onShouldStartLoadWithRequestProp, minimumIOSVersion, unsupportedVersionComponent: UnsupportedVersionComponent, ...otherProps } = validateProps(props);
|
|
45
45
|
const webViewRef = useRef(null);
|
|
46
46
|
const onShouldStartLoadWithRequestCallback = useCallback((shouldStart, _url, lockIdentifier = 0) => {
|
|
47
47
|
const viewManager = RNCWebViewManager;
|
|
@@ -105,7 +105,7 @@ const WebViewComponent = forwardRef((props, ref) => {
|
|
|
105
105
|
const webViewContainerStyle = [styles.container, containerStyle];
|
|
106
106
|
const decelerationRate = processDecelerationRate(decelerationRateProp);
|
|
107
107
|
const NativeWebView = RNCWebView;
|
|
108
|
-
const webView = (<NativeWebView key="webViewKey" {...otherProps} enableApplePay={enableApplePay} javaScriptEnabled={javaScriptEnabled} cacheEnabled={cacheEnabled}
|
|
108
|
+
const webView = (<NativeWebView key="webViewKey" {...otherProps} enableApplePay={enableApplePay} javaScriptEnabled={javaScriptEnabled} cacheEnabled={cacheEnabled} dataDetectorTypes={dataDetectorTypes} useSharedProcessPool={useSharedProcessPool} textInteractionEnabled={textInteractionEnabled} decelerationRate={decelerationRate} messagingEnabled={typeof onMessageProp === 'function'} onLoadingError={onLoadingError} onLoadingFinish={onLoadingFinish} onLoadingProgress={onLoadingProgress} onLoadingStart={onLoadingStart} onMessage={onMessage} onShouldStartLoadWithRequest={onShouldStartLoadWithRequest} injectedJavaScript={injectedJavaScript} injectedJavaScriptBeforeContentLoaded={injectedJavaScriptBeforeContentLoaded} allowsInlineMediaPlayback={allowsInlineMediaPlayback} incognito={incognito} mediaPlaybackRequiresUserAction={mediaPlaybackRequiresUserAction} ref={webViewRef} sharedCookiesEnabled={sharedCookiesEnabled}
|
|
109
109
|
// TODO: find a better way to type this.
|
|
110
110
|
source={source} style={webViewStyles}/>);
|
|
111
111
|
return (<View style={webViewContainerStyle}>
|
package/lib/WebViewShared.d.ts
CHANGED
|
@@ -34,5 +34,4 @@ export declare const useWebWiewLogic: ({ startInLoadingState, onLoadStart, onLoa
|
|
|
34
34
|
lastErrorEvent: WebViewError | null;
|
|
35
35
|
};
|
|
36
36
|
export declare const versionPasses: (version: string | undefined, minimum: string | undefined) => boolean;
|
|
37
|
-
export declare const removeHttpsFromOrigins: (whitelist: string[]) => string[];
|
|
38
37
|
//# sourceMappingURL=WebViewShared.d.ts.map
|
package/lib/WebViewShared.js
CHANGED
package/lib/WebViewTypes.d.ts
CHANGED
|
@@ -145,7 +145,7 @@ export interface BasicAuthCredential {
|
|
|
145
145
|
}
|
|
146
146
|
export interface CommonNativeWebViewProps extends ViewProps {
|
|
147
147
|
cacheEnabled?: boolean;
|
|
148
|
-
|
|
148
|
+
cameraPermissionOriginWhitelist?: string[];
|
|
149
149
|
incognito?: boolean;
|
|
150
150
|
injectedJavaScript?: string;
|
|
151
151
|
injectedJavaScriptBeforeContentLoaded?: string;
|
|
@@ -639,7 +639,7 @@ export interface WebViewSharedProps extends ViewProps {
|
|
|
639
639
|
/**
|
|
640
640
|
* Defines a list of domain origins that can access camera.
|
|
641
641
|
*/
|
|
642
|
-
readonly
|
|
642
|
+
readonly cameraPermissionOriginWhitelist?: string[];
|
|
643
643
|
/**
|
|
644
644
|
* Stylesheet object to set the style of the container view.
|
|
645
645
|
*/
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"Thibault Malbranche <malbranche.thibault@gmail.com>"
|
|
10
10
|
],
|
|
11
11
|
"license": "MIT",
|
|
12
|
-
"version": "11.26.1-exodus.
|
|
12
|
+
"version": "11.26.1-exodus.34",
|
|
13
13
|
"homepage": "https://github.com/ExodusMovement/react-native-webview#readme",
|
|
14
14
|
"scripts": {
|
|
15
15
|
"android": "react-native run-android",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
o/classes
|
package/android/build/.transforms/bd1c9282aaabf4a0d1b6bb39aff484a4/transformed/classes/classes.dex
DELETED
|
Binary file
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Automatically generated file. DO NOT MODIFY
|
|
3
|
-
*/
|
|
4
|
-
package com.reactnativecommunity.webview;
|
|
5
|
-
|
|
6
|
-
public final class BuildConfig {
|
|
7
|
-
public static final boolean DEBUG = Boolean.parseBoolean("true");
|
|
8
|
-
public static final String LIBRARY_PACKAGE_NAME = "com.reactnativecommunity.webview";
|
|
9
|
-
public static final String BUILD_TYPE = "debug";
|
|
10
|
-
}
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/AndroidManifest.xml
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
3
|
-
package="com.reactnativecommunity.webview" >
|
|
4
|
-
|
|
5
|
-
<uses-sdk
|
|
6
|
-
android:minSdkVersion="23"
|
|
7
|
-
android:targetSdkVersion="29" />
|
|
8
|
-
|
|
9
|
-
<uses-feature android:name="android.hardware.camera.any" />
|
|
10
|
-
|
|
11
|
-
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
|
12
|
-
<uses-permission android:name="android.permission.CAMERA" />
|
|
13
|
-
<uses-permission android:name="android.permission.INTERNET" />
|
|
14
|
-
|
|
15
|
-
<application>
|
|
16
|
-
<provider
|
|
17
|
-
android:name="com.reactnativecommunity.webview.RNCWebViewFileProvider"
|
|
18
|
-
android:authorities="dollar_openBracket_applicationId_closeBracket.fileprovider"
|
|
19
|
-
android:exported="false"
|
|
20
|
-
android:grantUriPermissions="true" >
|
|
21
|
-
<meta-data
|
|
22
|
-
android:name="android.support.FILE_PROVIDER_PATHS"
|
|
23
|
-
android:resource="@xml/file_provider_paths" />
|
|
24
|
-
</provider>
|
|
25
|
-
</application>
|
|
26
|
-
|
|
27
|
-
</manifest>
|
package/android/build/intermediates/aapt_friendly_merged_manifests/debug/aapt/output-metadata.json
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"artifactType": {
|
|
4
|
-
"type": "AAPT_FRIENDLY_MERGED_MANIFESTS",
|
|
5
|
-
"kind": "Directory"
|
|
6
|
-
},
|
|
7
|
-
"applicationId": "com.reactnativecommunity.webview",
|
|
8
|
-
"variantName": "debug",
|
|
9
|
-
"elements": [
|
|
10
|
-
{
|
|
11
|
-
"type": "SINGLE",
|
|
12
|
-
"filters": [],
|
|
13
|
-
"attributes": [],
|
|
14
|
-
"outputFile": "AndroidManifest.xml"
|
|
15
|
-
}
|
|
16
|
-
],
|
|
17
|
-
"elementType": "File"
|
|
18
|
-
}
|
package/android/build/intermediates/annotation_processor_list/debug/annotationProcessors.json
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
Binary file
|
|
Binary file
|