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.

See Also:
  • Method Details

    • createHttpRequest

      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

      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 is false, 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

      String getCookie(URL url)
      Method used to implement Javascript document.cookie property.
    • setCookie

      void setCookie(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.
    • getSecurityPolicy

      Policy getSecurityPolicy()
      Gets the security policy for scripting. Return null 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(String mediaName)
      Returns true if the current media matches the name provided.
      Parameters:
      mediaName - Media name, which may be screen, tty, etc. (See HTML Specification).
    • getVendor

      String getVendor()
    • getProduct

      String getProduct()