ionic-team / capacitor

Build cross-platform Native Progressive Web Apps for iOS, Android, and the Web ⚡️
https://capacitorjs.com
MIT License
12.26k stars 1.01k forks source link

[Feature]: TWA Support #7719

Closed DanielHerr closed 1 month ago

DanielHerr commented 1 month ago

Description

Android TWA support as Webview alternative

Platforms

Request or proposed solution

TWAs run inside Chrome instead of in a Webview, so it can have superior rendering performance #4187, and many Web APIs are supported in Chrome but not in Webview.

As of Chrome 115, TWA supports messaging between Android and Web code, so as far as I know it should be possible to implement Capacitor.

Alternatives

No response

Additional Information

https://developer.chrome.com/docs/android/post-message-twa

jcesarmobile commented 1 month ago

TWAs load external websites, while Capacitor apps load local assets that are shipped with the app. Also Capacitor relies in the WebView request interception to act as a local web server, which is not possible in TWAs, so lo load local requests in a TWA it would require to use a real local web server, which would be insecure and I'm not even sure if that would work for a TWA.

ionitron-bot[bot] commented 1 week ago

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Capacitor, please create a new issue and ensure the template is fully filled out.