> Markdown version of [Accessing Web Page And Browser Information](https://vaadin.com/docs/v8/framework/articles/AccessingWebPageAndBrowserInformation). Section index: [llms.txt](https://vaadin.com/docs/v8/framework/llms.txt)

# <a id="accessing-web-page-and-browser-information"></a>Accessing web page and browser information

Vaadin 7 includes a new **Page** class offering access to various client-side information and events concerning the web page and browser window in which the Vaadin UI resides. The Page instance corresponding to a given UI is accessed via the `getPage()` method of the UI or using a static method `Page.getCurrent()`.

You can access the browser window size and add size change listeners:

```java
Page page = someUI.getPage();
page.addBrowserWindowResizeListener(new BrowserWindowResizeListener() {
  public void browserWindowResized(BrowserWindowResizeEvent event) {
    Notification.show("Window width=" + event.getWidth() + ", height=" + event.getHeight());
  }
});
```

You can access the optional fragment part of the location URI and add fragment change listeners:

```java
page.setUriFragment(page.getUriFragment() + "foo");
page.addUriFragmentChangedListener(new UriFragmentChangedListener() {
  public void uriFragmentChanged(UriFragmentChangedEvent event) {
    Notification.show("Fragment=" + event.getUriFragment());
  }
});
```

Note: HTML is disabled by default in Notifications, but can be enabled with setHtmlContentAllowed(true). When enabled, you can use any HTML markup in the caption and description of a notification. If it is in any way possible to get the notification content from user input, you should either disallow HTML or sanitize the content carefully, as noted in ["Sanitizing User Input to Prevent Cross-Site Scripting"](https://vaadin.com/docs/v8/framework/advanced/advanced-security.md#advanced.security.sanitizing).

You can access client browser details:

```java
Notification.show("IP" + browser.getAddress() +
                "User-Agent:" + browser.getBrowserApplication() +
                "Linux: " + browser.isLinux());
```

[Live Demo](https://demo.vaadin.com/sampler/#foundation/advanced/browser-information)

Note: If you are using a reverse proxy, you must get the value `X-Forwarded-For` from request headers. You cannot get a browser name, but you can check which browser are using.
