org.lobobrowser.html

Interface UserAgentContext

Known Implementing Classes:
SimpleUserAgentContext

public interface UserAgentContext

Provides information about the user agent (browser) driving the parser and/or renderer.

Method Summary

HttpRequest
createHttpRequest()
Creates an instance of HttpRequest which can be used by the renderer to load images, scripts, external style sheets, and implement the Javascript XMLHttpRequest class (AJAX).
String
getAppCodeName()
Gets browser "code" name.
String
getAppMinorVersion()
Gets browser application minor version.
String
getAppName()
Gets browser application name.
String
getAppVersion()
Gets browser application version.
String
getBrowserLanguage()
Gets browser language code.
String
getCookie(java.net.URL url)
Method used to implement Javascript document.cookie property.
String
getPlatform()
Gets the name of the user's operating system.
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.
String
getUserAgent()
Should return the string used in the User-Agent header.
String
getVendor()
boolean
isCookieEnabled()
Returns a boolean value indicating whether cookies are enabled in the user agent.
boolean
isMedia(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, String cookieSpec)
Method used to implement document.cookie property.

Method Details

createHttpRequest

public HttpRequest createHttpRequest()
Creates an instance of HttpRequest which can be used by the renderer to load images, scripts, external style sheets, and implement the Javascript XMLHttpRequest class (AJAX).

getAppCodeName

public String getAppCodeName()
Gets browser "code" name.

getAppMinorVersion

public String getAppMinorVersion()
Gets browser application minor version.

getAppName

public String getAppName()
Gets browser application name.

getAppVersion

public String getAppVersion()
Gets browser application version.

getBrowserLanguage

public String getBrowserLanguage()

getCookie

public String getCookie(java.net.URL url)
Method used to implement Javascript document.cookie property.

getPlatform

public String getPlatform()
Gets the name of the user's operating system.

getProduct

public String getProduct()

getScriptingOptimizationLevel

public int getScriptingOptimizationLevel()
Gets the scripting optimization level, which is a value equivalent to Rhino's optimization level.

getSecurityPolicy

public java.security.Policy getSecurityPolicy()
Gets the security policy for scripting. Return null if JavaScript code is trusted.

getUserAgent

public String getUserAgent()
Should return the string used in the User-Agent header.

getVendor

public String getVendor()

isCookieEnabled

public boolean isCookieEnabled()
Returns a boolean value indicating whether cookies are enabled in the user agent. This value is used for reporting purposes only.

isMedia

public boolean isMedia(String mediaName)
Returns true if the current media matches the name provided.

isScriptingEnabled

public boolean isScriptingEnabled()
Returns a boolean value indicating whether scripting is enabled in the user agent. If this value is false, the parser will not process scripts and Javascript element attributes will have no effect.

setCookie

public void setCookie(java.net.URL url,
                      String cookieSpec)
Method used to implement document.cookie property.
Parameters:
cookieSpec - Specification of cookies, as they would appear in the Set-Cookie header value of HTTP.