diff --git a/articles/flow/advanced/browser-access.adoc b/articles/flow/advanced/browser-access.adoc index 677840ddee..a8e32fd61f 100644 --- a/articles/flow/advanced/browser-access.adoc +++ b/articles/flow/advanced/browser-access.adoc @@ -31,7 +31,23 @@ UI.getCurrent().getPage().fetchCurrentURL(currentUrl -> { }); ---- -// TODO add documentation on VaadinSession.getCurrent().getBrowser() +== Accessing Browser Information + +During the initial HTTP request, Vaadin reads the user-agent information supplied by the browser and stores them in a [classname]`WebBrowser` instance, which is accessible from the current [classname]`VaadinSession`. + +Here’s an example how to get the `WebBrowser` instance and access some of the user-agent information: + +[source,java] +---- +WebBrowser browser = VaadinSession.getCurrent().getBrowser(); +// Print the raw user-agent string +System.out.println(browser.getBrowserApplication()); +// Print some parsed browser details +System.out.println("Is Windows: " + browser.isWindows()); +System.out.println("Is Chrome: " + browser.isChrome()); +System.out.println("Major version: " + browser.getBrowserMajorVersion()); +---- + == Getting the Extended Client-Side Details