[webview_flutter_wkebview] Verify JavaScriptChannels have a unique name#5904
Merged
auto-submit[bot] merged 3 commits intoflutter:mainfrom Jan 17, 2024
Merged
Conversation
hellohuanlin
approved these changes
Jan 16, 2024
packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart
Outdated
Show resolved
Hide resolved
jmagman
reviewed
Jan 17, 2024
| Future<void> addJavaScriptChannel( | ||
| JavaScriptChannelParams javaScriptChannelParams, | ||
| ) { | ||
| final String channelName = javaScriptChannelParams.name; |
Member
There was a problem hiding this comment.
Is somewhere already checking this isn't an empty string?
This parameter must be unique within the user content controller and must not be an empty string.
Contributor
Author
There was a problem hiding this comment.
Yea it checks it here with an assert: https://github.com/flutter/packages/blob/main/packages/webview_flutter/webview_flutter_wkwebview/lib/src/webkit_webview_controller.dart#L695
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jan 18, 2024
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jan 18, 2024
flutter/packages@1a2b780...83c2c4d 2024-01-18 stuartmorgan@google.com [google_maps_flutter] Restore the arm64 workaround (flutter/packages#5915) 2024-01-17 10687576+bparrishMines@users.noreply.github.com [pigeon] Separates message call code generation into separate methods in the KotlinGenerator (flutter/packages#5891) 2024-01-17 10687576+bparrishMines@users.noreply.github.com [webview_flutter_wkebview] Verify JavaScriptChannels have a unique name (flutter/packages#5904) 2024-01-17 10687576+bparrishMines@users.noreply.github.com [pigeon] Separates message call code generation into separate methods in the `DartGenerator` (flutter/packages#5859) 2024-01-17 engine-flutter-autoroll@skia.org Roll Flutter from 8e94423 to def6af0 (23 revisions) (flutter/packages#5911) 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,rmistry@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
12 tasks
16 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes flutter/flutter#141242
According to WKUserContentController.addScriptMessageHandler, a handler must have a unique name. In flutter/flutter#141242, this led to a crash. This PR prevents the app crash and throws an error from Dart when the method is called.
Pre-launch Checklist
dart format.)[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style.///).If you need help, consider asking for advice on the #hackers-new channel on Discord.