Example app that demonstrate a possible bug in Chrome 72 WebView on Android. Clone the repo, load in to Android Studio, build and push to a device.
Turns out this is an issue to do with how we are passing the HTML into the web view. See the fixed
branch for details and the bug report for discussion.
We received a report from one of our users today saying that a certain part of our app that relies on a WebView stopped working. We tracked it down to being a difference between Chrome 71 and Chrome 72 installed on the device.
When debugging what the WebView was doing we noticed that, whilst we were passing it a correct looking HTML string, the WebView did not render anything. We looked at the Elements tab in the remote Chrome Dev Tools and noticed the document was heavily truncated. So we could understand why the rendering wasn't working..... the document as it it was trying to render was broken.
Upon closer inspection it appeared to break before the first use of the # character in the inline CSS. So our assumption is that something between Chrome 71 and Chrome 72 broke handling of this use of CSS.
As far as I am aware what we are trying to render in the WebView is a valid, albeit poor, use of HTML / CSS and it should work as before.
- Build and load the example project onto an Android device.
- Ensure that you have Chrome 71 (I used 71.0.3578.99) installed as the stable version of Chrome.
- Ensure that you have Chrome 72 (72.0.3626.73) installed as the beta version of Chrome.
- Select the stable version (Chrome 71) from the Developer Options -> WebView Implementation.
- Run the Chrome72Bug example app.
- Select the FAB button to load an example HTML into the WebView.
- Switch to the beta version (Chrome 72) from the Developer Options -> WebView Implemenation.
- Run the Chrome72Bug example app.
- Select the FAB button to load an example HTML into the WebView.
After step (6) and (9) the example HTML will be rendered in the WebView.
After step (9) the example HTML does not render.