Embedding Chrome to Android app

Hi everyone. If I’m not mistaken, Capacitor is using the device web view. I’m wondering if Chrome can be bundled with the apk to use that with Capacitor instead of depending to the version of the device.

I think that Cordova supported this so maybe there is a way to do this in Capacitor as well?

Why would you want to do this? it would make the size of your app significantly larger than it’s supposed to be.

Assuming you’re thinking of GitHub - ionic-team/cordova-plugin-ionic-webview: Web View plugin for Cordova, specialized for Ionic apps., the WkWebView it includes is already used by Capacitor. So as to “can Capacitor do what was previously doable with Cordova”, I’d say “yes, but it already is”. I guess that means that if you’re not satisfied with what Capacitor is doing out of the box, then I am unaware of any other method of swapping out the webview, and I do not believe that that cordova plugin is compatible with Capacitor.

It would certainly make the app size larger but the reason behind my thinking is that I would be sure that what I test during development is what’s actually happening to the user’s device too. It would be a nice way to avoid edge cases for devices with different browser versions.

@rapropos I was thinking about Crosswalk which was compatible with Cordova.

this plugin you mention is way out of date. Was created 8 years ago and last time this plugin was updated was 4 years ago. This is not suggested to use it.

The most recent Crosswalk release was in 2016. The minimum version of Chrome we support on Android is Chrome 60, released in mid-2017. Chrome 60 is a great baseline to target and allows the following things without needing any build tools

  • Proxy
  • ESModules
  • CSS Grid/Flexbox
  • Arrow functions
  • Template literals

And even then, that’s the bottom support from someone who hasn’t updated their phone in 5 years. Chrome 62 (late 2017) has dynamic imports. Chrome 67 (early 2018) has Big Int. Chrome 80 (early 2020) has nullish coalescing. Chrome updates independently of the phone’s OS, so there probably very few people actually on Chrome 60.

And the list goes on! Unless you’re using very cutting edge APIs that were drafted up within the last year or so, something like the Temporal API, you can get away with a lot without even needing to transpile your code.

1 Like