is it feasible to open a tab on default browser wi...
# random
e
is it feasible to open a tab on default browser with a specific address from kotlin? (desktop, no Android)
s
On the JVM, easy:
Desktop.getDesktop.browse(…)
❤️ 1
e
I was skimming through all the android results..
ok, now comes the hard part, I'd like to fill some credentials.. @Sam, do you happen to know this as well? Or could you point me into some directions?
s
It really depends on what your end goal is
But knowing which browser is being used is going to be important, I think
e
I have a tray program to login to the company vpn, now I'd like to add a menu option to automatically login into the personal page with credentials+totp
s
Depending on how much control you have over the login system, I'd say the most robust approach would be to have the app exchange the credentials for a single-use token before opening the browser, then just stick the token in the URL as a
GET
parameter
👍 2
But of course, that only works if you can set up the required mechanisms for obtaining and using the token
Actually interacting with the browser to fill in credentials and submit a login form is probably not possible in the general case, though you might be able to get it working in a tightly-controlled environment with a known browser
e
if you're looking into remote controlling browsers, there is webdriver and related projects like appium. that requires different drivers for different browsers, and it may not be possible to interact with existing browser sessions/profiles
if you embed a webview into your app, that gives you far more control over it, but also completely separates it from the system browser (no shared data)