Skip to content

Conversation

stuartmorgan-g
Copy link
Collaborator

Adds an Android-level method to control the mixed content mode.

Fixes flutter/flutter#43595

Pre-Review Checklist

Footnotes

  1. 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 3

google-labs-jules bot and others added 6 commits July 9, 2025 16:50
This commit introduces a new Android-specific API `setMixedContentMode` to the `webview_flutter` plugin.
This allows developers to control how the WebView handles mixed content (HTTP content on an HTTPS page).

Fixes flutter/flutter#43595
@stuartmorgan-g
Copy link
Collaborator Author

This was an experiment in using Jules on flutter/packages, and in particular seeing what it would make of a plugin using ProxyApi. The initial commit is what it created, then the rest was me making it work to see what it got right and wrong. Since figuring that out was most of the work of making a full PR, we may as well land it.

Some notes on the Jules aspect for our future experiments:

  • The prompt was minimal, and I also didn't do any feedback cycles with it. In retrospect I should have tried to get it to do the enum part via follow-up prompting, since that was the most tedious change to add by hand.
  • It did much better than I expected with our use of generators. For proxy API, it didn't try to change any of the generated code, but it did generate code on the Dart and Java side that was basically correct for what the generator made when I ran it. Not bad!
  • It generated an integration test that wasn't very useful (I just removed it). Interestingly it did leave a TODO(bparrishMines) to make the test useful 🤣
  • The Dart unit test, which should have been trivial given the other examples of similar tests in that file, was entirely hallucinated. I'm not sure what happened there; that should have been one of the easiest parts of the PR for it.
  • It doesn't seem to understand Java project structure enough from repo context to know that it didn't need to API-level gate the calls given our min version.

I didn't expect it to handle proxy API plugins very well at all, so in some respects it exceeded expectations. I think it was probably a net negative in time spent, but only barely, and with better prompting might do better. It is interesting that other than test it made changes to basically all the right files, in the right places, and did a reasonable job at wiring it all up. That suggests that someone using it who was completely new to the plugin might well find it useful as a starting point.

Copy link
Contributor

@bparrishMines bparrishMines left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Co-authored-by: Maurice Parrish <10687576+bparrishMines@users.noreply.github.com>
@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 15, 2025
Copy link
Contributor

auto-submit bot commented Jul 15, 2025

autosubmit label was removed for flutter/packages/9586, because - The status or check suite Linux_android android_build_all_packages stable has failed. Please fix the issues identified (or deflake) before re-applying this label.

@auto-submit auto-submit bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 15, 2025
@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 15, 2025
@auto-submit auto-submit bot merged commit 1dc479b into flutter:main Jul 15, 2025
78 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 17, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jul 17, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Jul 17, 2025
flutter/packages@4a231ae...cb8fef6

2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.activity:activity from 1.9.3 to 1.10.1 in
/packages/image_picker/image_picker_android/android
(flutter/packages#8725)
2025-07-17 stuartmorgan@google.com [webview_flutter] Update
androidx.webkit to 1.14.0 (flutter/packages#9638)
2025-07-17 engine-flutter-autoroll@skia.org Roll Flutter from
c2739f0 to 9c626d9 (18 revisions) (flutter/packages#9641)
2025-07-17 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
077b4a4 to d7b523b (3 revisions) (flutter/packages#9640)
2025-07-17 stuartmorgan@google.com Fix Gemini note wrapping
(flutter/packages#9639)
2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.android.gms:play-services-maps from 18.2.0
to 19.2.0 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#9120)
2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.fragment:fragment from 1.6.2 to 1.8.8 in
/packages/local_auth/local_auth_android/android (flutter/packages#9406)
2025-07-16 stuartmorgan@google.com [ci] Add Gemini Code Assist review
config (flutter/packages#9632)
2025-07-16 engine-flutter-autoroll@skia.org Roll Flutter from
cc3110c to c2739f0 (15 revisions) (flutter/packages#9633)
2025-07-16 105786499+syedaniq@users.noreply.github.com [image_picker]
redesign example app (flutter/packages#9625)
2025-07-16 robert.odrowaz@leancode.pl [camera_avfoundation]
Implementation swift migration - part 7 (flutter/packages#9595)
2025-07-15 10687576+bparrishMines@users.noreply.github.com
[webview_flutter_wkwebview] Replace Flutter method failure assertion
with nslog (flutter/packages#9587)
2025-07-15 engine-flutter-autoroll@skia.org Roll Flutter from
a930ec1 to cc3110c (24 revisions) (flutter/packages#9631)
2025-07-15 stuartmorgan@google.com [webview_flutter] Add
setMixedContentMode for Android (flutter/packages#9586)
2025-07-15 stuartmorgan@google.com [google_sign_in] Add exception info
to migration guide (flutter/packages#9574)
2025-07-14 392199+kwikwag@users.noreply.github.com [camera_android] Use
WeakReference to prevent startImageStream OOM error when main thread
hangs (#166533) (flutter/packages#9571)
2025-07-14 jason-simmons@users.noreply.github.com [quick_actions]
Restore the appShortcutLaunchActivityAfterStarting test in
quick_actions_android (flutter/packages#9508)
2025-07-14 engine-flutter-autoroll@skia.org Roll Flutter from
35f197f to a930ec1 (3 revisions) (flutter/packages#9624)
2025-07-14 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.android.tools.build:gradle from 8.9.1 to 8.11.1
in /packages/pigeon/platform_tests/test_plugin/android
(flutter/packages#9618)
2025-07-12 engine-flutter-autoroll@skia.org Roll Flutter from
43657f3 to 35f197f (39 revisions) (flutter/packages#9602)
2025-07-11 stuartmorgan@google.com Replace popularity badges
(flutter/packages#9594)
2025-07-11 1961493+harryterkelsen@users.noreply.github.com [rfw] Update
test to not depend on toString() (flutter/packages#9590)
2025-07-11 robert.odrowaz@leancode.pl [camera_avfoundation]
Implementation swift migration - part 6 (flutter/packages#9588)
2025-07-10 52160996+FMorschel@users.noreply.github.com [url_launcher]
Fixes new unnecessary boolean operations warnings
(flutter/packages#9409)
2025-07-10 stuartmorgan@google.com [google_sign_in] Add troubleshooting
to Android README (flutter/packages#9581)
2025-07-10 engine-flutter-autoroll@skia.org Roll Flutter from
ac12f66 to 43657f3 (25 revisions) (flutter/packages#9589)
2025-07-10 32538273+ValentinVignal@users.noreply.github.com
[go_router_builder] Update case sensitive test to `go_router` 16.0.0
(flutter/packages#9482)
2025-07-09 737941+loic-sharma@users.noreply.github.com [rfw] Remove the
RFW WASM example (flutter/packages#9551)
2025-07-09 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
fcf2c11 to 077b4a4 (5 revisions) (flutter/packages#9585)
2025-07-09 engine-flutter-autoroll@skia.org Roll Flutter from
adffe24 to ac12f66 (28 revisions) (flutter/packages#9584)
2025-07-09 malo.allee@gmail.com [video_player] Add html 5 video poster
support (thumbnail) as a VideoPlayerWebOptions (flutter/packages#8940)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
azatech pushed a commit to azatech/flutter that referenced this pull request Jul 28, 2025
…er#172303)

flutter/packages@4a231ae...cb8fef6

2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.activity:activity from 1.9.3 to 1.10.1 in
/packages/image_picker/image_picker_android/android
(flutter/packages#8725)
2025-07-17 stuartmorgan@google.com [webview_flutter] Update
androidx.webkit to 1.14.0 (flutter/packages#9638)
2025-07-17 engine-flutter-autoroll@skia.org Roll Flutter from
c2739f0 to 9c626d9 (18 revisions) (flutter/packages#9641)
2025-07-17 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
077b4a4 to d7b523b (3 revisions) (flutter/packages#9640)
2025-07-17 stuartmorgan@google.com Fix Gemini note wrapping
(flutter/packages#9639)
2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.android.gms:play-services-maps from 18.2.0
to 19.2.0 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#9120)
2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.fragment:fragment from 1.6.2 to 1.8.8 in
/packages/local_auth/local_auth_android/android (flutter/packages#9406)
2025-07-16 stuartmorgan@google.com [ci] Add Gemini Code Assist review
config (flutter/packages#9632)
2025-07-16 engine-flutter-autoroll@skia.org Roll Flutter from
cc3110c to c2739f0 (15 revisions) (flutter/packages#9633)
2025-07-16 105786499+syedaniq@users.noreply.github.com [image_picker]
redesign example app (flutter/packages#9625)
2025-07-16 robert.odrowaz@leancode.pl [camera_avfoundation]
Implementation swift migration - part 7 (flutter/packages#9595)
2025-07-15 10687576+bparrishMines@users.noreply.github.com
[webview_flutter_wkwebview] Replace Flutter method failure assertion
with nslog (flutter/packages#9587)
2025-07-15 engine-flutter-autoroll@skia.org Roll Flutter from
a930ec1 to cc3110c (24 revisions) (flutter/packages#9631)
2025-07-15 stuartmorgan@google.com [webview_flutter] Add
setMixedContentMode for Android (flutter/packages#9586)
2025-07-15 stuartmorgan@google.com [google_sign_in] Add exception info
to migration guide (flutter/packages#9574)
2025-07-14 392199+kwikwag@users.noreply.github.com [camera_android] Use
WeakReference to prevent startImageStream OOM error when main thread
hangs (flutter#166533) (flutter/packages#9571)
2025-07-14 jason-simmons@users.noreply.github.com [quick_actions]
Restore the appShortcutLaunchActivityAfterStarting test in
quick_actions_android (flutter/packages#9508)
2025-07-14 engine-flutter-autoroll@skia.org Roll Flutter from
35f197f to a930ec1 (3 revisions) (flutter/packages#9624)
2025-07-14 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.android.tools.build:gradle from 8.9.1 to 8.11.1
in /packages/pigeon/platform_tests/test_plugin/android
(flutter/packages#9618)
2025-07-12 engine-flutter-autoroll@skia.org Roll Flutter from
43657f3 to 35f197f (39 revisions) (flutter/packages#9602)
2025-07-11 stuartmorgan@google.com Replace popularity badges
(flutter/packages#9594)
2025-07-11 1961493+harryterkelsen@users.noreply.github.com [rfw] Update
test to not depend on toString() (flutter/packages#9590)
2025-07-11 robert.odrowaz@leancode.pl [camera_avfoundation]
Implementation swift migration - part 6 (flutter/packages#9588)
2025-07-10 52160996+FMorschel@users.noreply.github.com [url_launcher]
Fixes new unnecessary boolean operations warnings
(flutter/packages#9409)
2025-07-10 stuartmorgan@google.com [google_sign_in] Add troubleshooting
to Android README (flutter/packages#9581)
2025-07-10 engine-flutter-autoroll@skia.org Roll Flutter from
ac12f66 to 43657f3 (25 revisions) (flutter/packages#9589)
2025-07-10 32538273+ValentinVignal@users.noreply.github.com
[go_router_builder] Update case sensitive test to `go_router` 16.0.0
(flutter/packages#9482)
2025-07-09 737941+loic-sharma@users.noreply.github.com [rfw] Remove the
RFW WASM example (flutter/packages#9551)
2025-07-09 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
fcf2c11 to 077b4a4 (5 revisions) (flutter/packages#9585)
2025-07-09 engine-flutter-autoroll@skia.org Roll Flutter from
adffe24 to ac12f66 (28 revisions) (flutter/packages#9584)
2025-07-09 malo.allee@gmail.com [video_player] Add html 5 video poster
support (thumbnail) as a VideoPlayerWebOptions (flutter/packages#8940)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
vashworth pushed a commit to vashworth/packages that referenced this pull request Jul 30, 2025
Adds an Android-level method to control the mixed content mode.

Fixes flutter/flutter#43595

## Pre-Review Checklist

[^1]: Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling.
ksokolovskyi pushed a commit to ksokolovskyi/flutter that referenced this pull request Aug 19, 2025
…er#172303)

flutter/packages@4a231ae...cb8fef6

2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.activity:activity from 1.9.3 to 1.10.1 in
/packages/image_picker/image_picker_android/android
(flutter/packages#8725)
2025-07-17 stuartmorgan@google.com [webview_flutter] Update
androidx.webkit to 1.14.0 (flutter/packages#9638)
2025-07-17 engine-flutter-autoroll@skia.org Roll Flutter from
c2739f0 to 9c626d9 (18 revisions) (flutter/packages#9641)
2025-07-17 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
077b4a4 to d7b523b (3 revisions) (flutter/packages#9640)
2025-07-17 stuartmorgan@google.com Fix Gemini note wrapping
(flutter/packages#9639)
2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.google.android.gms:play-services-maps from 18.2.0
to 19.2.0 in
/packages/google_maps_flutter/google_maps_flutter_android/android
(flutter/packages#9120)
2025-07-17 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump androidx.fragment:fragment from 1.6.2 to 1.8.8 in
/packages/local_auth/local_auth_android/android (flutter/packages#9406)
2025-07-16 stuartmorgan@google.com [ci] Add Gemini Code Assist review
config (flutter/packages#9632)
2025-07-16 engine-flutter-autoroll@skia.org Roll Flutter from
cc3110c to c2739f0 (15 revisions) (flutter/packages#9633)
2025-07-16 105786499+syedaniq@users.noreply.github.com [image_picker]
redesign example app (flutter/packages#9625)
2025-07-16 robert.odrowaz@leancode.pl [camera_avfoundation]
Implementation swift migration - part 7 (flutter/packages#9595)
2025-07-15 10687576+bparrishMines@users.noreply.github.com
[webview_flutter_wkwebview] Replace Flutter method failure assertion
with nslog (flutter/packages#9587)
2025-07-15 engine-flutter-autoroll@skia.org Roll Flutter from
a930ec1 to cc3110c (24 revisions) (flutter/packages#9631)
2025-07-15 stuartmorgan@google.com [webview_flutter] Add
setMixedContentMode for Android (flutter/packages#9586)
2025-07-15 stuartmorgan@google.com [google_sign_in] Add exception info
to migration guide (flutter/packages#9574)
2025-07-14 392199+kwikwag@users.noreply.github.com [camera_android] Use
WeakReference to prevent startImageStream OOM error when main thread
hangs (flutter#166533) (flutter/packages#9571)
2025-07-14 jason-simmons@users.noreply.github.com [quick_actions]
Restore the appShortcutLaunchActivityAfterStarting test in
quick_actions_android (flutter/packages#9508)
2025-07-14 engine-flutter-autoroll@skia.org Roll Flutter from
35f197f to a930ec1 (3 revisions) (flutter/packages#9624)
2025-07-14 49699333+dependabot[bot]@users.noreply.github.com
[dependabot]: Bump com.android.tools.build:gradle from 8.9.1 to 8.11.1
in /packages/pigeon/platform_tests/test_plugin/android
(flutter/packages#9618)
2025-07-12 engine-flutter-autoroll@skia.org Roll Flutter from
43657f3 to 35f197f (39 revisions) (flutter/packages#9602)
2025-07-11 stuartmorgan@google.com Replace popularity badges
(flutter/packages#9594)
2025-07-11 1961493+harryterkelsen@users.noreply.github.com [rfw] Update
test to not depend on toString() (flutter/packages#9590)
2025-07-11 robert.odrowaz@leancode.pl [camera_avfoundation]
Implementation swift migration - part 6 (flutter/packages#9588)
2025-07-10 52160996+FMorschel@users.noreply.github.com [url_launcher]
Fixes new unnecessary boolean operations warnings
(flutter/packages#9409)
2025-07-10 stuartmorgan@google.com [google_sign_in] Add troubleshooting
to Android README (flutter/packages#9581)
2025-07-10 engine-flutter-autoroll@skia.org Roll Flutter from
ac12f66 to 43657f3 (25 revisions) (flutter/packages#9589)
2025-07-10 32538273+ValentinVignal@users.noreply.github.com
[go_router_builder] Update case sensitive test to `go_router` 16.0.0
(flutter/packages#9482)
2025-07-09 737941+loic-sharma@users.noreply.github.com [rfw] Remove the
RFW WASM example (flutter/packages#9551)
2025-07-09 engine-flutter-autoroll@skia.org Roll Flutter (stable) from
fcf2c11 to 077b4a4 (5 revisions) (flutter/packages#9585)
2025-07-09 engine-flutter-autoroll@skia.org Roll Flutter from
adffe24 to ac12f66 (28 revisions) (flutter/packages#9584)
2025-07-09 malo.allee@gmail.com [video_player] Add html 5 video poster
support (thumbnail) as a VideoPlayerWebOptions (flutter/packages#8940)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App p: webview_flutter platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[webview_flutter] Add option to allow mixed-mode content (http in https page)
2 participants