- All Known Implementing Classes:
AndroidBrowserService
,DesktopBrowserService
,DummyBrowserService
,IOSBrowserService
public interface BrowserService
Launches the default browser of the platform as a separate application process. The browser
will be opened with the provided URL.
Example
BrowserService.create().ifPresent(service -> {
service.launchExternalBrowser("https://gluonhq.com/");
});
Android Configuration: none
iOS Configuration: none
- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic Optional<BrowserService>
create()
Returns an instance ofBrowserService
.void
Launches the user-default browser to show a specified URL.
-
Method Details
-
create
Returns an instance ofBrowserService
.- Returns:
- An instance of
BrowserService
.
-
launchExternalBrowser
Launches the user-default browser to show a specified URL.- Parameters:
url
- The URL to load when the browser application opens.- Throws:
IOException
- If the URL can't be openedURISyntaxException
- If it is not a valid URL string
-