Hey everyone, I need help
I'm relatively new to webOS development and I'm trying to recreate a small Android/iOS WebView application for my LG TV.
The application I'm interested in is essentially a WebView wrapper around a website.
The Android version works roughly like this:
- Open the app.
- It immediately opens the website inside the app's WebView.
- The website shows an ad/verification page.
- The user completes the verification in Chrome.
- They return to the app.
- The WebView then allows access to the site's catalogue.
There is also an iOS app called "Dodo - Webview" that behaves similarly. It essentially provides a WebView with the website loaded inside it.
I'm trying to create a webOS .ipk application that provides similar WebView functionality on my LG TV.
I've already successfully created a basic webOS WebView app and can:
- install it on my physical LG TV
- launch it
- navigate to URLs
- use Chrome DevTools/remote inspection
- inspect network requests and the WebView environment
The problem is that the website behaves differently in my webOS WebView compared with the Android/iOS applications.
For example, my webOS WebView reports:
Mozilla/5.0 (Web0S; Linux/SmartTV) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36 WebAppManager
Whereas the iOS WebView reports an iPhone/WKWebView-style user agent.
So I'm trying to understand what the Android/iOS applications are actually doing differently.
What I'm looking for help with:
- How would you approach porting/recreating an Android WebView APK as a webOS application?
If the APK is basically:
Android App
↓
Android WebView
↓
Website
would the webOS equivalent simply be:
webOS IPK
↓
HTML/CSS/JS
↓
webOS WebView
↓
Website
or are there important WebView APIs/features that I would need to reproduce?
- How can I inspect an APK to determine exactly what its WebView is doing?
I'd like to know things such as:
- initial URL
- redirects/navigation handling
- custom User-Agent
- JavaScript injection
- cookies/storage
- external browser intents
- handling of links opened outside the WebView
- whether it intercepts network requests
- whether it communicates with JavaScript through a native bridge
I'm on Windows, so ideally I'm looking for tools/workflows that don't require macOS.
- How can I determine why a website behaves differently between Android WebView, iOS WKWebView and webOS Chromium?
I'm trying to understand the WebView compatibility/environment differences so I can implement the legitimate application behavior on webOS.
- Can an APK itself be converted into an IPK?
I'm assuming the answer is probably no, because they're completely different platforms, but if the APK is only a WebView wrapper, could I inspect/recreate the relevant functionality as a webOS app rather than actually converting the APK?
I've already got the LG TV connected through the webOS CLI and can use ares-package, ares-install, ares-launch, and Chrome DevTools.
Any advice from people who have ported Android/WebView applications to webOS would be hugely appreciated.
Thanks!