[webview_flutter_android] Expose allowFileAccessFromFileURLs and allowUniversalAccessFromFileURLs - #12330
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
There was a problem hiding this comment.
Code Review
This pull request adds support for configuring file URL access permissions (setAllowFileAccessFromFileURLs and setAllowUniversalAccessFromFileURLs) in the Android WebView plugin. This includes updates to Pigeon definitions, generated Kotlin and Dart bindings, the controller implementation, and corresponding unit tests. The review feedback suggests replacing @NotNull with @NonNull in WebSettingsProxyApi.java to maintain consistency with the rest of the codebase.
…iversalAccessFromFileURLs
aeb03e5 to
a478ace
Compare
This PR exposes Android WebView file URL access settings through
AndroidWebViewController.The following Android
WebSettingsAPIs are added:setAllowFileAccessFromFileURLssetAllowUniversalAccessFromFileURLsThese settings allow applications loading local web content using
file://URLs to explicitly configure whether local resources and resources from other origins can be accessed.This is useful for applications embedding local HTML assets that need to load additional local files or communicate with remote web services.
The APIs are only available on Android and do not affect other WebView implementations.
Issues
N/A
This is an API enhancement request to expose existing Android WebSettings functionality.
Pre-Review Checklist
[shared_preferences]///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.Footnotes
Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. ↩ ↩2