From 5a453662ca02cd250421cfd1236a665674608f34 Mon Sep 17 00:00:00 2001 From: zidongliu Date: Tue, 25 Apr 2023 20:50:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20[webview=E9=9A=90=E7=A7=81=E5=90=88?= =?UTF-8?q?=E8=A7=84]=E5=88=A0=E9=99=A4allowFileAccessFromFileURLs?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/RNCWebView.h | 1 - ios/RNCWebView.m | 4 ---- ios/RNCWebViewManager.m | 1 - js/WebViewTypes.js | 10 ---------- 4 files changed, 16 deletions(-) diff --git a/ios/RNCWebView.h b/ios/RNCWebView.h index 2ce7a8e..80f295f 100644 --- a/ios/RNCWebView.h +++ b/ios/RNCWebView.h @@ -47,7 +47,6 @@ @property (nonatomic, copy) NSString * _Nullable applicationNameForUserAgent; @property (nonatomic, assign) BOOL cacheEnabled; @property (nonatomic, assign) BOOL javaScriptEnabled; -@property (nonatomic, assign) BOOL allowFileAccessFromFileURLs; @property (nonatomic, assign) BOOL allowsLinkPreview; @property (nonatomic, assign) BOOL showsHorizontalScrollIndicator; @property (nonatomic, assign) BOOL showsVerticalScrollIndicator; diff --git a/ios/RNCWebView.m b/ios/RNCWebView.m index c80020a..7ee6cb4 100644 --- a/ios/RNCWebView.m +++ b/ios/RNCWebView.m @@ -148,10 +148,6 @@ static NSString *const kPostMessageHost = @"postMessage"; prefs.javaScriptEnabled = NO; _prefsUsed = YES; } - if (_allowFileAccessFromFileURLs) { - [prefs setValue:@TRUE forKey:@"allowFileAccessFromFileURLs"]; - _prefsUsed = YES; - } if (_prefsUsed) { wkWebViewConfig.preferences = prefs; } diff --git a/ios/RNCWebViewManager.m b/ios/RNCWebViewManager.m index 065e41f..25bf8d6 100644 --- a/ios/RNCWebViewManager.m +++ b/ios/RNCWebViewManager.m @@ -54,7 +54,6 @@ RCT_EXPORT_VIEW_PROPERTY(onContentProcessDidTerminate, RCTDirectEventBlock) RCT_EXPORT_VIEW_PROPERTY(injectedJavaScript, NSString) RCT_EXPORT_VIEW_PROPERTY(injectedJavaScriptBeforeContentLoaded, NSString) RCT_EXPORT_VIEW_PROPERTY(javaScriptEnabled, BOOL) -RCT_EXPORT_VIEW_PROPERTY(allowFileAccessFromFileURLs, BOOL) RCT_EXPORT_VIEW_PROPERTY(allowsInlineMediaPlayback, BOOL) RCT_EXPORT_VIEW_PROPERTY(mediaPlaybackRequiresUserAction, BOOL) #if WEBKIT_IOS_10_APIS_AVAILABLE diff --git a/js/WebViewTypes.js b/js/WebViewTypes.js index 742030d..3f12d44 100644 --- a/js/WebViewTypes.js +++ b/js/WebViewTypes.js @@ -208,7 +208,6 @@ export interface AndroidNativeWebViewProps extends CommonNativeWebViewProps { cacheMode?: CacheMode; allowFileAccess?: boolean; scalesPageToFit?: boolean; - allowFileAccessFromFileURLs?: boolean; allowUniversalAccessFromFileURLs?: boolean; androidHardwareAccelerationDisabled?: boolean; domStorageEnabled?: boolean; @@ -467,15 +466,6 @@ export interface AndroidWebViewProps extends WebViewSharedProps { */ geolocationEnabled?: boolean; - - /** - * Boolean that sets whether JavaScript running in the context of a file - * scheme URL should be allowed to access content from other file scheme URLs. - * Including accessing content from other file scheme URLs - * @platform android - */ - allowFileAccessFromFileURLs?: boolean; - /** * Boolean that sets whether JavaScript running in the context of a file * scheme URL should be allowed to access content from any origin. -- Gitee