Package org.lobobrowser.html
Interface UserAgentContext
-
- All Known Implementing Classes:
SimpleUserAgentContext
public interface UserAgentContext
Provides 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 HttpRequest
createHttpRequest()
Creates an instance ofHttpRequest
which can be used by the renderer to load images, scripts, external style sheets, and implement the Javascript XMLHttpRequest class (AJAX).java.lang.String
getAppCodeName()
Gets browser "code" name.java.lang.String
getAppMinorVersion()
Gets browser application minor version.java.lang.String
getAppName()
Gets browser application name.java.lang.String
getAppVersion()
Gets browser application version.java.lang.String
getBrowserLanguage()
Gets browser language code.java.lang.String
getCookie(java.net.URL url)
Method used to implement Javascriptdocument.cookie
property.java.lang.String
getPlatform()
Gets the name of the user's operating system.java.lang.String
getProduct()
int
getScriptingOptimizationLevel()
Gets the scripting optimization level, which is a value equivalent to Rhino's optimization level.java.security.Policy
getSecurityPolicy()
Gets the security policy for scripting.java.lang.String
getUserAgent()
Should return the string used in the User-Agent header.java.lang.String
getVendor()
boolean
isCookieEnabled()
Returns a boolean value indicating whether cookies are enabled in the user agent.boolean
isExternalCSSEnabled()
Returns a boolean value indicating whether remote (non-inline) CSS documents should be loaded.boolean
isMedia(java.lang.String mediaName)
Returns true if the current media matches the name provided.boolean
isScriptingEnabled()
Returns a boolean value indicating whether scripting is enabled in the user agent.void
setCookie(java.net.URL url, java.lang.String cookieSpec)
Method used to implementdocument.cookie
property.
-
-
-
Method Detail
-
createHttpRequest
HttpRequest createHttpRequest()
Creates an instance ofHttpRequest
which 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.cookie
property.
-
setCookie
void setCookie(java.net.URL url, java.lang.String cookieSpec)
Method used to implementdocument.cookie
property.- 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. Returnnull
if 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()
-
-