Package org.lobobrowser.html
Interface UserAgentContext
-
- All Known Implementing Classes:
SimpleUserAgentContext
public interface UserAgentContextProvides information about the user agent (browser) driving the parser and/or renderer.A simple implementation of this interface is provided in
SimpleUserAgentContext.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description HttpRequestcreateHttpRequest()Creates an instance ofHttpRequestwhich can be used by the renderer to load images, scripts, external style sheets, and implement the Javascript XMLHttpRequest class (AJAX).java.lang.StringgetAppCodeName()Gets browser "code" name.java.lang.StringgetAppMinorVersion()Gets browser application minor version.java.lang.StringgetAppName()Gets browser application name.java.lang.StringgetAppVersion()Gets browser application version.java.lang.StringgetBrowserLanguage()Gets browser language code.java.lang.StringgetCookie(java.net.URL url)Method used to implement Javascriptdocument.cookieproperty.java.lang.StringgetPlatform()Gets the name of the user's operating system.java.lang.StringgetProduct()intgetScriptingOptimizationLevel()Gets the scripting optimization level, which is a value equivalent to Rhino's optimization level.java.security.PolicygetSecurityPolicy()Gets the security policy for scripting.java.lang.StringgetUserAgent()Should return the string used in the User-Agent header.java.lang.StringgetVendor()booleanisCookieEnabled()Returns a boolean value indicating whether cookies are enabled in the user agent.booleanisExternalCSSEnabled()Returns a boolean value indicating whether remote (non-inline) CSS documents should be loaded.booleanisMedia(java.lang.String mediaName)Returns true if the current media matches the name provided.booleanisScriptingEnabled()Returns a boolean value indicating whether scripting is enabled in the user agent.voidsetCookie(java.net.URL url, java.lang.String cookieSpec)Method used to implementdocument.cookieproperty.
-
-
-
Method Detail
-
createHttpRequest
HttpRequest createHttpRequest()
Creates an instance ofHttpRequestwhich can be used by the renderer to load images, scripts, external style sheets, and implement the Javascript XMLHttpRequest class (AJAX).
-
getAppCodeName
java.lang.String getAppCodeName()
Gets browser "code" name.
-
getAppName
java.lang.String getAppName()
Gets browser application name.
-
getAppVersion
java.lang.String getAppVersion()
Gets browser application version.
-
getAppMinorVersion
java.lang.String getAppMinorVersion()
Gets browser application minor version.
-
getBrowserLanguage
java.lang.String getBrowserLanguage()
Gets browser language code. See ISO 639-1 codes.
-
isCookieEnabled
boolean isCookieEnabled()
Returns a boolean value indicating whether cookies are enabled in the user agent. This value is used for reporting purposes only.
-
isScriptingEnabled
boolean isScriptingEnabled()
Returns a boolean value indicating whether scripting is enabled in the user agent. If this value isfalse, the parser will not process scripts and Javascript element attributes will have no effect.
-
isExternalCSSEnabled
boolean isExternalCSSEnabled()
Returns a boolean value indicating whether remote (non-inline) CSS documents should be loaded.
-
getPlatform
java.lang.String getPlatform()
Gets the name of the user's operating system.
-
getUserAgent
java.lang.String getUserAgent()
Should return the string used in the User-Agent header.
-
getCookie
java.lang.String getCookie(java.net.URL url)
Method used to implement Javascriptdocument.cookieproperty.
-
setCookie
void setCookie(java.net.URL url, java.lang.String cookieSpec)Method used to implementdocument.cookieproperty.- Parameters:
cookieSpec- Specification of cookies, as they would appear in the Set-Cookie header value of HTTP.
-
getSecurityPolicy
java.security.Policy getSecurityPolicy()
Gets the security policy for scripting. Returnnullif JavaScript code is trusted.
-
getScriptingOptimizationLevel
int getScriptingOptimizationLevel()
Gets the scripting optimization level, which is a value equivalent to Rhino's optimization level.
-
isMedia
boolean isMedia(java.lang.String mediaName)
Returns true if the current media matches the name provided.- Parameters:
mediaName- Media name, which may bescreen,tty, etc. (See HTML Specification).
-
getVendor
java.lang.String getVendor()
-
getProduct
java.lang.String getProduct()
-
-