Inform developers and users when the WebView component is outdated
#148
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.
This makes it possible to detect out-of-the-box when the system
WebViewcomponent is outdated on a device. This can happen (to developers) when using an older Android Emulator without Play Services or (to users) when Google Chrome or Android System WebView automatic app updates have been disabled in the Play Store.Rails 8 requires Chrome
120+for its default configuration:Rails returns an HTTP
406when an unsupported Chromium WebView version tries to access the server. To make this easier to identify, the following improvements have been added:Log warning
A new debug log will be present when using a WebView version older than
WebViewInfo.REQUIRED_WEBVIEW_VERSION, which is currently set to120. Example log warning:Error screen with description
The default error view included in the framework now includes the specific
VisitErrordescription. For an HTTP406, this will read:Outdated WebView alert dialog
Developers can now use the new
WebViewVersionCompatibilityclass to display an alert dialog in their app if the WebView version is outdated. Call it like:This dialog looks like the following screenshot and allows a user to update the WebView component through the Play Store:
