public class ExtendedClientDetails extends Object implements Serializable
Please note that all information is fetched only once, and not updated
automatically. To retrieve updated values, you can execute JS with
Page.executeJs(String, Serializable...)
and get the current value
back.
Modifier and Type | Method and Description |
---|---|
int |
getBodyClientHeight()
Gets the height of the body element in the document in pixels.
|
int |
getBodyClientWidth()
Gets the width of the body element in the document in pixels.
|
Date |
getCurrentDate()
Returns the current date and time of the browser.
|
double |
getDevicePixelRatio()
Gets the device pixel ratio,
window.devicePixelRatio . |
int |
getDSTSavings()
Returns the offset in milliseconds between the browser's GMT TimeZone and
DST.
|
int |
getRawTimezoneOffset()
Returns the browser-reported TimeZone offset in milliseconds from GMT
ignoring possible daylight saving adjustments that may be in effect in
the browser.
|
int |
getScreenHeight()
Gets the height of the screen in pixels.
|
int |
getScreenWidth()
Gets the width of the screen in pixels.
|
String |
getTimeZoneId()
Returns the TimeZone Id (like "Europe/Helsinki") provided by the browser
(if the browser supports this feature).
|
int |
getTimezoneOffset()
Returns the browser-reported TimeZone offset in milliseconds from GMT.
|
int |
getWindowInnerHeight()
Gets the inner height of the browser window
window.innerHeight in
pixels. |
int |
getWindowInnerWidth()
Gets the inner width of the browser window
window.innerWidth in
pixels. |
String |
getWindowName()
Returns a unique browser window identifier.
|
boolean |
isDSTInEffect()
Returns whether daylight saving time (DST) is currently in effect in the
region of the browser or not.
|
boolean |
isIOS()
Check if the browser is run on IOS.
|
boolean |
isIPad()
Check if the browser is run on IPad.
|
boolean |
isTouchDevice()
Checks if the browser supports touch events.
|
public int getScreenWidth()
public int getScreenHeight()
public int getWindowInnerHeight()
window.innerHeight
in
pixels. This includes the scrollbar, if it is visible.public int getWindowInnerWidth()
window.innerWidth
in
pixels. This includes the scrollbar, if it is visible.public int getBodyClientHeight()
public int getBodyClientWidth()
public int getTimezoneOffset()
getRawTimezoneOffset()
.getRawTimezoneOffset()
public String getTimeZoneId()
public int getRawTimezoneOffset()
You can use this to figure out which TimeZones the user could actually be
in by calling TimeZone.getAvailableIDs(int)
.
If getRawTimezoneOffset()
and getTimezoneOffset()
returns the same value, the browser is either in a zone that does not
currently have daylight saving time, or in a zone that never has daylight
saving time.
public int getDSTSavings()
public boolean isDSTInEffect()
public Date getCurrentDate()
To get the actual date and time shown in the end users computer, you can do something like:
WebBrowser browser = ...; SimpleTimeZone timeZone = new SimpleTimeZone(browser.getTimezoneOffset(), "Fake client time zone"); DateFormat format = DateFormat.getDateTimeInstance(); format.setTimeZone(timeZone); myLabel.setValue(format.format(browser.getCurrentDate()));
isDSTInEffect()
,
getDSTSavings()
,
getTimezoneOffset()
public boolean isTouchDevice()
public double getDevicePixelRatio()
window.devicePixelRatio
. See more
from MDN
web docs.
A value of -1 indicates that the value was not reported by the browser correctly.
public String getWindowName()
public boolean isIPad()
public boolean isIOS()
true
if run on IOS , false
if the user is not
using IOS or if no information from the browser is presentCopyright © 2025. All rights reserved.