-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
[webview_flutter] Adds support for receiving a url with WebResourceError #3884
Conversation
@override | ||
// Temporarily ignored as this will be added to the parent platform interface | ||
// class. | ||
// ignore: overridden_fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be temporarily included in the platform interface PR to keep CI happy. This shouldn't be a breaking change.
if ([error.userInfo[key] isKindOfClass:[NSString class]]) { | ||
userInfo[key] = error.userInfo[key]; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value can be any object from any library, so this only checks for Strings. This could also check for the other pigeon supported values too, e.g. NSNumbers
too if needed. We currently only use the failingURL and localizedDescription.
@@ -226,7 +243,15 @@ class NSError { | |||
final String domain; | |||
|
|||
/// A string containing the localized description of the error. | |||
final String localizedDescription; | |||
String? get localizedDescription => | |||
userInfo[NSErrorUserInfoKey.NSLocalizedDescription] as String?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is actually nullable in the Objc NSError
and is always equal to this value in the userInfo
map.
failingUrl
to the interface and webview_flutter_wkwebview
...ges/webview_flutter/webview_flutter_platform_interface/lib/src/types/web_resource_error.dart
Outdated
Show resolved
Hide resolved
packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFGeneratedWebKitApis.h
Show resolved
Hide resolved
failingUrl
to the interface and webview_flutter_wkwebview
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few minor comments, but looks good to start splitting out the individual PRs.
packages/webview_flutter/webview_flutter_android/lib/src/android_webview_controller.dart
Outdated
Show resolved
Hide resolved
packages/webview_flutter/webview_flutter_wkwebview/ios/Classes/FWFDataConverters.m
Outdated
Show resolved
Hide resolved
...s/webview_flutter/webview_flutter_wkwebview/example/ios/RunnerTests/FWFDataConvertersTests.m
Outdated
Show resolved
Hide resolved
packages/webview_flutter/webview_flutter_wkwebview/lib/src/legacy/web_kit_webview_widget.dart
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
flutter/packages@aa1eace...369ee7e 2023-07-14 reidbaker@google.com [Tool] New tool to download android dependencies (flutter/packages#4408) 2023-07-14 zaldypagaduanjr@gmail.com [video_player] added iOS exception on incorrect asset path (flutter/packages#4318) 2023-07-14 joonas.kerttula@codemate.com [google_maps_flutter_platform_interface] Add support for cloud-based map styling (flutter/packages#4141) 2023-07-14 10687576+bparrishMines@users.noreply.github.com [webview_flutter] Adds support for receiving a url with WebResourceError (flutter/packages#3884) 2023-07-14 stuartmorgan@google.com [xdg_directories] Remove `process` dependency (flutter/packages#4460) 2023-07-13 stuartmorgan@google.com [various] Update Pigeon in Swift plugins (flutter/packages#4461) 2023-07-13 engine-flutter-autoroll@skia.org Roll Flutter from 544d30d to c40173f (10 revisions) (flutter/packages#4457) 2023-07-13 engine-flutter-autoroll@skia.org Roll Flutter (stable) from 796c8ef to f468f33 (2 revisions) (flutter/packages#4456) 2023-07-13 bisor0627@gmail.com Fix Router Config Issues #4300 (go_router_builder/example) (flutter/packages#4369) 2023-07-13 10687576+bparrishMines@users.noreply.github.com [webview_flutter_platform_interface] Adds url to `WebResourceError` (flutter/packages#4439) 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
flutter/packages@aa1eace...369ee7e 2023-07-14 reidbaker@google.com [Tool] New tool to download android dependencies (flutter/packages#4408) 2023-07-14 zaldypagaduanjr@gmail.com [video_player] added iOS exception on incorrect asset path (flutter/packages#4318) 2023-07-14 joonas.kerttula@codemate.com [google_maps_flutter_platform_interface] Add support for cloud-based map styling (flutter/packages#4141) 2023-07-14 10687576+bparrishMines@users.noreply.github.com [webview_flutter] Adds support for receiving a url with WebResourceError (flutter/packages#3884) 2023-07-14 stuartmorgan@google.com [xdg_directories] Remove `process` dependency (flutter/packages#4460) 2023-07-13 stuartmorgan@google.com [various] Update Pigeon in Swift plugins (flutter/packages#4461) 2023-07-13 engine-flutter-autoroll@skia.org Roll Flutter from 544d30d to c40173f (10 revisions) (flutter/packages#4457) 2023-07-13 engine-flutter-autoroll@skia.org Roll Flutter (stable) from 796c8ef to f468f33 (2 revisions) (flutter/packages#4456) 2023-07-13 bisor0627@gmail.com Fix Router Config Issues flutter#4300 (go_router_builder/example) (flutter/packages#4369) 2023-07-13 10687576+bparrishMines@users.noreply.github.com [webview_flutter_platform_interface] Adds url to `WebResourceError` (flutter/packages#4439) 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…#4439) Platform interface portion of flutter/packages#3884
Fixes flutter/flutter#125682
Pre-launch Checklist
dart format
.)[shared_preferences]
pubspec.yaml
with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.CHANGELOG.md
to 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.