NativeAlphaForAndroid icon indicating copy to clipboard operation
NativeAlphaForAndroid copied to clipboard

Chrome Custom Tabs as optional WebView holders

Open linuxct opened this issue 5 years ago • 2 comments

Opening this issue to further discuss this idea: Have you considered an option to enable Chrome Custom Tabs as a method to display a desired web page?

If you find this option would be a nice addition to NativeAlpha, I'm willing to implement it myself and submit a PR.

linuxct avatar Jul 19 '20 10:07 linuxct

Reference: https://developer.chrome.com/multidevice/android/customtabs#whentouse

linuxct avatar Jul 19 '20 10:07 linuxct

Thanks, I did not know this Chrome feature beforehand. Had a quick look over the documentation but so far I do not see any major advantages over the WebView approach.

Apparently, the biggest advantage is a performance boost, but that is only true in very certain scenarios. Say we have an activity screen with a button named "Open my webshop" which should open a website with the webshop. In this scenario, the custom tab approach is great because it allows to preload the page even though the user is still on the activity and has not clicked on the button. But as soon as he does, the webshop will open in an instant. This is basically the scenario shown on the doc page.

However, this will never occur in Native Alpha, right? I have no clue (apart from behaviour tracking which is not an option obviously) which Web App the user will open next so there is no point in preloading anything.

Regarding other points mentioned:

  • Easier UI (toolbar etc) customization: Not really useful, the Web App should be fullscreen anyway.
  • Navigation awareness: Described behaviour is already implemented.
  • Security: This feature is also enabled in WebViews.
  • Shared cookies: Again this is the same for WebViews. Plus I do consider this rather a bug than a feature and I will look how I can make sure every Web App has its own set of cookies.

So all in all I am not convinced this approach would work better than with WebViews. Perhaps you can elaborate a bit more on possible advantages?

cylonid avatar Jul 19 '20 19:07 cylonid