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
Modifier and TypeMethodDescriptionCreates an instance ofHttpRequest
which can be used by the renderer to load images, scripts, external style sheets, and implement the Javascript XMLHttpRequest class (AJAX).Gets browser "code" name.Gets browser application minor version.Gets browser application name.Gets browser application version.Gets browser language code.Method used to implement Javascriptdocument.cookie
property.Gets the name of the user's operating system.int
Gets the scripting optimization level, which is a value equivalent to Rhino's optimization level.Gets the security policy for scripting.Should return the string used in the User-Agent header.boolean
Returns a boolean value indicating whether cookies are enabled in the user agent.boolean
Returns a boolean value indicating whether remote (non-inline) CSS documents should be loaded.boolean
Returns true if the current media matches the name provided.boolean
Returns a boolean value indicating whether scripting is enabled in the user agent.void
Method used to implementdocument.cookie
property.
-
Method Details
-
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
String getAppCodeName()Gets browser "code" name. -
getAppName
String getAppName()Gets browser application name. -
getAppVersion
String getAppVersion()Gets browser application version. -
getAppMinorVersion
String getAppMinorVersion()Gets browser application minor version. -
getBrowserLanguage
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
String getPlatform()Gets the name of the user's operating system. -
getUserAgent
String getUserAgent()Should return the string used in the User-Agent header. -
getCookie
Method used to implement Javascriptdocument.cookie
property. -
setCookie
Method used to implementdocument.cookie
property.- Parameters:
cookieSpec
- Specification of cookies, as they would appear in the Set-Cookie header value of HTTP.
-
getSecurityPolicy
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
Returns true if the current media matches the name provided.- Parameters:
mediaName
- Media name, which may bescreen
,tty
, etc. (See HTML Specification).
-
getVendor
String getVendor() -
getProduct
String getProduct()
-