org.lobobrowser.html
public interface UserAgentContext
A simple implementation of this interface is provided in
SimpleUserAgentContext
.
Modifier and Type | Method and Description |
---|---|
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). |
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 Javascript
document.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 implement
document.cookie property. |
HttpRequest createHttpRequest()
HttpRequest
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()
java.lang.String getAppName()
java.lang.String getAppVersion()
java.lang.String getAppMinorVersion()
java.lang.String getBrowserLanguage()
boolean isCookieEnabled()
boolean isScriptingEnabled()
false
,
the parser will not process scripts and Javascript element
attributes will have no effect.boolean isExternalCSSEnabled()
java.lang.String getPlatform()
java.lang.String getUserAgent()
java.lang.String getCookie(java.net.URL url)
document.cookie
property.void setCookie(java.net.URL url, java.lang.String cookieSpec)
document.cookie
property.cookieSpec
- Specification of cookies, as they
would appear in the Set-Cookie
header value of HTTP.java.security.Policy getSecurityPolicy()
null
if JavaScript code is trusted.int getScriptingOptimizationLevel()
boolean isMedia(java.lang.String mediaName)
mediaName
- Media name, which
may be screen
, tty
, etc. (See HTML Specification).java.lang.String getVendor()
java.lang.String getProduct()