B4J Question Closing a web browser window programmatically

avalle

Active Member
Licensed User
Longtime User
I am implementing an application that uses OAuth 2.0 to authorize access to external authenticated resources available from a service provider.
The authorization phase occurs starts within a web browser screen called with
B4X:
Dim job As HttpJob
job.Download(OAuth2Link)
When the OAuth authorization has completed (e.g. I have obtained the access_token), I want to close the web browser window programatically from the B4J app.

Is it ever possible?
It may be possible to constrain the context, e.g. running on Windows and using Chrome as the system-default web browser.

P.S. I am not using a Webview as recommended by Google, although the authorization server is not from Google.

Thanks
Andrea
 

Daestrum

Expert
Licensed User
Longtime User
You could close the current tab on the web browser, closing down the entire browser may upset users if they have other pages open in other tabs.

Something like in javascript (not tested)
browser.tab.remove(browser.tabs.getCurrent())
 
Last edited:
Upvote 0
Top