-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android WebView doesn't expose AllowFileAccess permissions #15604
Comments
WebView is close to getting deprecated and split out of React Native core. I recommend extending the WebView class as needed, and packaging it as a separate npm package. |
Thanks for the info and suggestion, @hramos! I'm now trying to extend the WebView class for my own use, but running into some issues. This appears to be a component:
However, I can't access any of the public methods that Android WebViews are supposed to expose, per https://developer.android.com/reference/android/webkit/WebView.html ( How can I access a native component given a reference like the one above? |
@hramos Do you have more information about the future deprecation of the WebView in React Native ? Like when or some links ? |
I want to disable file access within an Android WebView I'm creating using react-native's built-in WebView component.
The Android WebView docs say "File access is enabled by default.", and this is a security concern for my organization.
The react-native 0.31 docs mention a
getWebViewHandle
method that can be used to access the underlying WebView node; if this worked, then I could (presumably) write:However, later versions of the react-native docs don't mention
getWebViewHandle
, and when I run code like this in react-native 0.44 on an Android device, I get this error:My questions are:
How can we check if file access is enabled by default for the Android WebViews created by react-native's WebView component?
How can we disable this file access? Would we need to extend the WebView class, or fork and modify react-native?
Thanks for your time!
The text was updated successfully, but these errors were encountered: