WebView API22 and ES6

1,071 views
Skip to first unread message

Vanya Yakovlev

unread,
May 14, 2021, 12:55:05 PM5/14/21
to android-w...@chromium.org
Why does WebView API22 not support ES6 when updated with Google Chrome? I wanted to use let and const in JS, but the code fails.  http://ruanyf.github.io/es-checker/ chooses to support them. What should I do?
S10514-194829.jpg

Nate Fischer

unread,
May 14, 2021, 2:24:03 PM5/14/21
to Vanya Yakovlev, android-webview-dev
What is your WebView version (look for the "Android System WebView" package in settings)? Google Chrome and Android WebView are completely separate apps on API 22 (Lollipop MR1). Although they're both developed in the chromium codebase, each app has its own copy of the code so updating Chrome will not have any effect on WebView. However, you should still have the option to update Android WebView through the Play Store, in which case it should have roughly equivalent ECMAScript support as the latest release of Google Chrome.

Nate Fischer | Software Engineer | ntf...@google.com



On Fri, May 14, 2021 at 9:55 AM Vanya Yakovlev <winc...@gmail.com> wrote:
Why does WebView API22 not support ES6 when updated with Google Chrome? I wanted to use let and const in JS, but the code fails.  http://ruanyf.github.io/es-checker/ chooses to support them. What should I do?
S10514-194829.jpg

--
You received this message because you are subscribed to the Google Groups "android-webview-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-webview...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/android-webview-dev/CABDu-qCKy01sA-BP2EVmo_J-L13rmXCeut1qoK5D45NbzwYfcQ%40mail.gmail.com.

Vanya Yakovlev

unread,
May 14, 2021, 3:17:59 PM5/14/21
to Nate Fischer, android-webview-dev
Thanks, I'll check it out. Out of despair, I got into the system files and found out that I have 2 Android System WebViews. From Google and Meizu. I do not know how to set google by default. I have a Meizu M2.2021-05-14_212455.png
 note.

пт, 14 мая 2021 г. в 21:24, Nate Fischer <ntf...@google.com>:

Torne (Richard Coles)

unread,
May 14, 2021, 5:01:03 PM5/14/21
to Vanya Yakovlev, Nate Fischer, android-webview-dev
Standard versions of Android in API21/22/23 do not provide any way to choose which webview is used and does not support having more than one webview.

Unfortunately we are aware of some devices from this time where the device manufacturer included Google's standard and updatable webview and also a customised, vendor-specific webview which cannot be updated. Which webview gets used depends on what the device manufacturer did when setting this up. We do not know of any case where it is possible for the user or an app developer to choose (though that doesn't mean there isn't one); the cases we are aware of are all hardcoded to use one or the other based on the name of the app.

I'm not aware of this particular device so don't know how things work there, but it sounds likely that this device uses the vendor's outdated non-updateable webview by default and it's quite likely there is nothing you can do about it :(

As far as we know, no devices on Android 7 and later (API24+) have this kind of setup, and they all use our updatable webview if they are devices that have the Google apps preinstalled.

So you are probably just out of luck on this device; we can't do anything about it. :(

Vanya Yakovlev

unread,
May 15, 2021, 5:27:05 PM5/15/21
to Torne (Richard Coles), Nate Fischer, android-webview-dev
Thank you for the clarification. But it turns out that most of the users will not be able to use my application through no fault of my own. This problem may not be limited to Meizu. 
Why can't I specify which WebView to use when developing an application? If the user does not have it, make a notification about the installation of the required WebView. Some manufacturers still support Android 5 and 5.1.

сб, 15 мая 2021 г. в 00:01, Torne (Richard Coles) <to...@chromium.org>:

Torne (Richard Coles)

unread,
May 17, 2021, 10:41:06 AM5/17/21
to Vanya Yakovlev, Nate Fischer, android-webview-dev
On Sat, 15 May 2021 at 17:27, Vanya Yakovlev <winc...@gmail.com> wrote:
Thank you for the clarification. But it turns out that most of the users will not be able to use my application through no fault of my own. This problem may not be limited to Meizu. 

There are a limited number of devices that have this problem (only a small number of devices from a couple of vendors) and there should not be any on Android 7+, so the population of users with this issue is fairly small and decreasing. We realise this is awkward for app developers, but we can't do anything about it that we haven't already done - we already discussed the issue with vendors at length. Some devices were updated to no longer be configured in this incorrect way, others were not, but it was at least fixed for their future devices/rom images.

If you can't support such outdated versions of WebView in your app then there's not much you can do other than mark them as unsupported devices in the Play Store so that users can't install the app at all; the user won't be able to update it so prompting them about it won't help.
 
Why can't I specify which WebView to use when developing an application? If the user does not have it, make a notification about the installation of the required WebView. Some manufacturers still support Android 5 and 5.1.

We did not have any intention of there being more than one WebView on a device, so we didn't have any reason to implement a way to choose. You'd have to ask the vendor of this device, or reverse-engineer their customised framework code, to see if there is any way for your app to use the other one, but as I said on the other devices we've looked there has not been any such mechanism; the vendor just hardcoded particular apps to use one or the other and presumably this device, like others, has the outdated custom webview as the default.

Andrés Zsögön

unread,
May 12, 2022, 9:36:12 AM5/12/22
to android-webview-dev, to...@chromium.org, Nate Fischer, android-webview-dev, winc...@gmail.com
I was about to implement ES6 JS in certain Cordova apps but now that I confirmed that ES6 is not supported out-of-the-box in all the so-called updateable Webview implementations from Android 5.1 that will be postponed. The liberties given to vendors with Android and Webview implementations have created a whole world of incompatibilities and obsolete devices.

Torne (Richard Coles)

unread,
May 12, 2022, 11:32:28 AM5/12/22
to Andrés Zsögön, android-webview-dev, Nate Fischer, winc...@gmail.com
On Thu, 12 May 2022 at 09:36, Andrés Zsögön <andres...@gmail.com> wrote:
I was about to implement ES6 JS in certain Cordova apps but now that I confirmed that ES6 is not supported out-of-the-box in all the so-called updateable Webview implementations from Android 5.1 that will be postponed. The liberties given to vendors with Android and Webview implementations have created a whole world of incompatibilities and obsolete devices.

There are specific compatibility tests in place to ensure that WebView updates work correctly on vendor devices (even back in Android 5.x), but the devices that have this problem are configured such that the correct implementation would be used *when running the compatibility tests*. This is why they still have the Google updateable WebView installed and receiving updates, even though it's not used by all apps. :(
Reply all
Reply to author
Forward
0 new messages