Interface Network

All Superinterfaces:
Advisable<NetworkCallback>, Observable<NetworkEvent>, ProfileService

public interface Network extends ProfileService, Observable<NetworkEvent>, Advisable<NetworkCallback>
A service that provides access to the network-level functionality.
  • Method Details

    • httpAuthPreferences

      HttpAuthPreferences httpAuthPreferences()
      Returns an HTTP authorization preferences.
    • acceptLanguage

      String acceptLanguage()
      Returns a string that represents the Accept-Language request-header field. This field restricts the set of natural languages that are preferred as a response to the request. For example: da, en-gb;q=0.8, en;q=0.7. The default Accept-Language is en-us.

      See also: W3 Documentation : Header Field Definitions

      Throws:
      ObjectClosedException - when the profile is deleted or its engine is closed
    • acceptLanguage

      void acceptLanguage(String language)
      Configures the accept language. If you do not provide an accept-Language value using this method, then a default accept language will be used. The default Accept-Language is en-us.

      For example, fr, en-gb;q=0.8, en;q=0.7 would mean: "I prefer French, but will accept British English and other types of English". Note, that all languages which are assigned a quality factor greater than 0 are acceptable.

      See also: W3 Documentation : Header Field Definitions

      Parameters:
      language - a new string that represents the "Accept-Language" HTTP header value
      Throws:
      IllegalArgumentException - when language is empty or blank
      ObjectClosedException - when the profile is deleted or its engine is closed
    • userAgent

      String userAgent()
      Returns a string that represents the default user-agent.

      The default user-agent string can be configured through the EngineOptions.Builder.userAgent(String) method. If the default user-agent string has not been specified, then this method returns a string obtained from the Chromium engine.

      Throws:
      ObjectClosedException - when the profile is deleted or its engine is closed