public class ClientProperties extends Object implements IClusterable
BrowserInfoPage
.
A convenient way of letting Wicket do a sneaky redirect to BrowserInfoPage
(and back
again) is to put this in your Application's init method:
getRequestCycleSettings().setGatherExtendedBrowserInfo(true);WARNING: Be sure you think about the dangers of depending on information you pull from the client too much. They may be easily spoofed or inaccurate in other ways, and properties like window and browser size are all too easy to be used naively.
BrowserInfoPage
,
Serialized FormConstructor and Description |
---|
ClientProperties() |
Modifier and Type | Method and Description |
---|---|
int |
getBrowserHeight() |
int |
getBrowserVersionMajor() |
int |
getBrowserVersionMinor() |
int |
getBrowserWidth() |
String |
getHostname() |
String |
getNavigatorAppCodeName() |
String |
getNavigatorAppName() |
String |
getNavigatorAppVersion() |
String |
getNavigatorLanguage() |
String |
getNavigatorPlatform() |
String |
getNavigatorUserAgent() |
String |
getRemoteAddress() |
int |
getScreenColorDepth() |
int |
getScreenHeight() |
int |
getScreenWidth() |
TimeZone |
getTimeZone()
Get the client's time zone if that could be detected.
|
String |
getUtcDSTOffset() |
String |
getUtcOffset() |
boolean |
isBrowserChrome()
Flag indicating that the browser is a derivative of the Chrome browser platform.
|
boolean |
isBrowserEdge()
Flag indicating that the browser is a derivative of the Microsoft Edge browser platform.
|
boolean |
isBrowserInternetExplorer()
Flag indicating that the browser is a derivative of the Microsoft Internet Explorer browser
platform.
|
boolean |
isBrowserKonqueror()
Flag indicating that the browser is a derivative of the KDE Konqueror browser platform.
|
boolean |
isBrowserMozilla()
Flag indicating that the browser is a derivative of the Mozilla 1.0-1.8+ browser platform.
|
boolean |
isBrowserMozillaFirefox()
Flag indicating that the browser is a derivative of the Mozilla Firefox 1.0+ browser
platform.
|
boolean |
isBrowserOpera()
Flag indicating that the browser is a derivative of the Opera browser platform.
|
boolean |
isBrowserSafari()
Flag indicating that the browser is a derivative of the Apple Safari browser platform.
|
boolean |
isCookiesEnabled()
Deprecated.
use
isNavigatorCookieEnabled() instead |
boolean |
isJavaEnabled()
Deprecated.
use
isNavigatorJavaEnabled() instead |
boolean |
isJavaScriptEnabled()
Flag indicating support of JavaScript in the browser.
|
boolean |
isNavigatorCookieEnabled() |
boolean |
isNavigatorJavaEnabled() |
void |
read(IRequestParameters parameters)
Read parameters.
|
void |
setBrowserChrome(boolean browserChrome)
Flag indicating that the browser is a derivative of the Chrome browser platform.
|
void |
setBrowserEdge(boolean browserEdge)
Flag indicating that the browser is a derivative of the Microsoft Edge browser platform.
|
void |
setBrowserHeight(int browserHeight) |
void |
setBrowserInternetExplorer(boolean browserInternetExplorer)
Flag indicating that the browser is a derivative of the Microsoft Internet Explorer browser
platform.
|
void |
setBrowserKonqueror(boolean browserKonqueror)
Flag indicating that the browser is a derivative of the KDE Konqueror browser platform.
|
void |
setBrowserMozilla(boolean browserMozilla)
Flag indicating that the browser is a derivative of the Mozilla 1.0-1.8+ browser platform.
|
void |
setBrowserMozillaFirefox(boolean browserMozillaFirefox)
Flag indicating that the browser is a derivative of the Mozilla Firefox 1.0+ browser
platform.
|
void |
setBrowserOpera(boolean browserOpera)
Flag indicating that the browser is a derivative of the Opera browser platform.
|
void |
setBrowserSafari(boolean browserSafari)
Flag indicating that the browser is a derivative of the Apple Safari browser platform.
|
void |
setBrowserVersionMajor(int browserVersionMajor) |
void |
setBrowserVersionMinor(int browserVersionMinor) |
void |
setBrowserWidth(int browserWidth) |
void |
setHostname(String hostname) |
void |
setJavaScriptEnabled(boolean javaScriptEnabled) |
void |
setNavigatorAppCodeName(String navigatorAppCodeName) |
void |
setNavigatorAppName(String navigatorAppName) |
void |
setNavigatorAppVersion(String navigatorAppVersion) |
void |
setNavigatorCookieEnabled(boolean cookiesEnabled) |
void |
setNavigatorJavaEnabled(boolean navigatorJavaEnabled) |
void |
setNavigatorLanguage(String navigatorLanguage) |
void |
setNavigatorPlatform(String navigatorPlatform) |
void |
setNavigatorUserAgent(String navigatorUserAgent) |
void |
setRemoteAddress(String remoteAddress) |
void |
setScreenColorDepth(int screenColorDepth) |
void |
setScreenHeight(int screenHeight) |
void |
setScreenWidth(int screenWidth) |
void |
setTimeZone(TimeZone timeZone)
Sets time zone.
|
void |
setUtcDSTOffset(String utcDSTOffset) |
void |
setUtcOffset(String utcOffset) |
String |
toString() |
public int getBrowserHeight()
public int getBrowserVersionMajor()
public int getBrowserVersionMinor()
public int getBrowserWidth()
public String getNavigatorAppCodeName()
public String getNavigatorAppName()
public String getNavigatorAppVersion()
public String getNavigatorLanguage()
public String getNavigatorPlatform()
public String getNavigatorUserAgent()
public String getRemoteAddress()
public String getHostname()
public int getScreenColorDepth()
public int getScreenHeight()
public int getScreenWidth()
public TimeZone getTimeZone()
public String getUtcDSTOffset()
public String getUtcOffset()
public boolean isJavaScriptEnabled()
public boolean isBrowserInternetExplorer()
public boolean isBrowserKonqueror()
public boolean isBrowserMozilla()
public boolean isBrowserMozillaFirefox()
public boolean isBrowserOpera()
public boolean isBrowserSafari()
public boolean isBrowserChrome()
public boolean isBrowserEdge()
public boolean isCookiesEnabled()
isNavigatorCookieEnabled()
insteadpublic boolean isJavaEnabled()
isNavigatorJavaEnabled()
insteadpublic boolean isNavigatorCookieEnabled()
public boolean isNavigatorJavaEnabled()
public void setBrowserHeight(int browserHeight)
browserHeight
- The height of the browserpublic void setBrowserInternetExplorer(boolean browserInternetExplorer)
browserInternetExplorer
- True if a derivative of the Microsoft Internet Explorer browser platform.public void setBrowserKonqueror(boolean browserKonqueror)
browserKonqueror
- True if a derivative of the KDE Konqueror browser platform.public void setBrowserMozilla(boolean browserMozilla)
browserMozilla
- True if a derivative of the Mozilla 1.0-1.8+ browser platform.public void setBrowserMozillaFirefox(boolean browserMozillaFirefox)
browserMozillaFirefox
- True if a derivative of the Mozilla Firefox 1.0+ browser platform.public void setBrowserOpera(boolean browserOpera)
browserOpera
- True if a derivative of the Opera browser platform.public void setBrowserSafari(boolean browserSafari)
browserSafari
- True if a derivative of the Apple Safari browser platform.public void setBrowserChrome(boolean browserChrome)
browserChrome
- True if a derivative of the Chrome browser platform.public void setBrowserEdge(boolean browserEdge)
browserEdge
- True if a derivative of the Microsoft Edge browser platform.public void setBrowserVersionMajor(int browserVersionMajor)
browserVersionMajor
- The major version number of the browser.public void setBrowserVersionMinor(int browserVersionMinor)
browserVersionMinor
- The minor version number of the browser.public void setBrowserWidth(int browserWidth)
browserWidth
- The browser widthpublic void setNavigatorCookieEnabled(boolean cookiesEnabled)
cookiesEnabled
- The client's navigator.cookieEnabled property.public void setNavigatorJavaEnabled(boolean navigatorJavaEnabled)
navigatorJavaEnabled
- The client's navigator.javaEnabled property.public void setNavigatorAppCodeName(String navigatorAppCodeName)
navigatorAppCodeName
- The client's navigator.appCodeName property.public void setNavigatorAppName(String navigatorAppName)
navigatorAppName
- The client's navigator.appName property.public void setNavigatorAppVersion(String navigatorAppVersion)
navigatorAppVersion
- The client's navigator.appVersion property.public void setNavigatorLanguage(String navigatorLanguage)
navigatorLanguage
- The client's navigator.language (or navigator.userLanguage) property.public void setNavigatorPlatform(String navigatorPlatform)
navigatorPlatform
- The client's navigator.platform property.public void setNavigatorUserAgent(String navigatorUserAgent)
navigatorUserAgent
- The client's navigator.userAgent property.public void setRemoteAddress(String remoteAddress)
remoteAddress
- The client's remote/ip address.public void setHostname(String hostname)
hostname
- the hostname shown in the browser.public void setScreenColorDepth(int screenColorDepth)
screenColorDepth
- Color depth of the screen in bits (integer).public void setScreenHeight(int screenHeight)
screenHeight
- Height of the screen in pixels (integer).public void setScreenWidth(int screenWidth)
screenWidth
- Height of the screen in pixels (integer).public void setTimeZone(TimeZone timeZone)
timeZone
- public void setUtcDSTOffset(String utcDSTOffset)
utcDSTOffset
- public void setUtcOffset(String utcOffset)
utcOffset
- The client's time offset from UTC in minutes (note: if you do this yourself, use
'new Date().getTimezoneOffset() / -60' (note the -)).public void setJavaScriptEnabled(boolean javaScriptEnabled)
javaScriptEnabled
- is JavaScript supported in the browserpublic void read(IRequestParameters parameters)
parameters
- parameters sent from browserCopyright © 2006–2019 Apache Software Foundation. All rights reserved.