[webview_flutter] Adds NavigationDelegate.onCreateWindow for target=_blank / window.open - #12312
[webview_flutter] Adds NavigationDelegate.onCreateWindow for target=_blank / window.open#12312mateusz-ramp wants to merge 4 commits into
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. |
589efad to
0d9fcf8
Compare
There was a problem hiding this comment.
Code Review
This pull request adds the NavigationDelegate.onCreateWindow callback to the webview_flutter packages to support handling new-window requests, such as target=_blank and window.open, on Android and iOS. The implementation spans the platform interface, Android, and iOS implementations, alongside corresponding tests and version bumps. Feedback on the iOS implementation recommends avoiding an asynchronous IPC call to retrieve the URL when onCreateWindow is not set, and ensuring that empty or null URLs fall back to the default loading behavior instead of being silently dropped.
1214698 to
017722e
Compare
|
@bparrishMines hello, this is my first contribution to Flutter Packages repo, I'm not sure how things work here. Seems like |
017722e to
c34e3a5
Compare
…ateWindow. # Conflicts: # packages/webview_flutter/webview_flutter_android/CHANGELOG.md
c34e3a5 to
71dfbf3
Compare
Adds an optional
NavigationDelegate.onCreateWindowcallback so hosts canhandle
target=_blank/window.open(e.g. open in an external browser)instead of only loading in the same WebView.
Behavior
onCreateWindowis set: Android (WebChromeClient.onCreateWindow→pigeon) and iOS/macOS (
WKUIDelegate.createWebViewWith) invoke the callbackwith the requested URL.
Packages (federated review PR)
webview_flutter_platform_interface2.16.0webview_flutter_android4.14.0webview_flutter_wkwebview3.27.0webview_flutter4.15.0Path
dependency_overridesare present for combined review only(
make-deps-path-based). This PR is not intended to land as-is; afterapproval we will land/publish in the usual federated order (platform
interface → implementations → app-facing).
Related issues
Related to:
Background (prior same-window
_blankhandling):Pre-Review Checklist
[shared_preferences]///).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