Class BrowserType.ConnectOptions

  • Enclosing interface:
    BrowserType

    public static class BrowserType.ConnectOptions
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String exposeNetwork
      This option exposes network available on the connecting client to the browser being connected to.
      java.util.Map<java.lang.String,​java.lang.String> headers
      Additional HTTP headers to be sent with web socket connect request.
      java.lang.Double slowMo
      Slows down Playwright operations by the specified amount of milliseconds.
      java.lang.Double timeout
      Maximum time in milliseconds to wait for the connection to be established.
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectOptions()  
    • Field Detail

      • exposeNetwork

        public java.lang.String exposeNetwork
        This option exposes network available on the connecting client to the browser being connected to. Consists of a list of rules separated by comma.

        Available rules:

        1. Hostname pattern, for example: example.com, *.org:99, x.*.y.com, *foo.org.
        2. IP literal, for example: 127.0.0.1, 0.0.0.0:99, [::1], [0:0::1]:99.
        3. <loopback> that matches local loopback interfaces: localhost, *.localhost, 127.0.0.1, [::1].

        Some common examples:

        1. "*" to expose all network.
        2. "<loopback>" to expose localhost network.
        3. "*.test.internal-domain,*.staging.internal-domain,<loopback>" to expose test/staging deployments and localhost.
      • headers

        public java.util.Map<java.lang.String,​java.lang.String> headers
        Additional HTTP headers to be sent with web socket connect request. Optional.
      • slowMo

        public java.lang.Double slowMo
        Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
      • timeout

        public java.lang.Double timeout
        Maximum time in milliseconds to wait for the connection to be established. Defaults to 0 (no timeout).
    • Constructor Detail

      • ConnectOptions

        public ConnectOptions()
    • Method Detail

      • setExposeNetwork

        public BrowserType.ConnectOptions setExposeNetwork​(java.lang.String exposeNetwork)
        This option exposes network available on the connecting client to the browser being connected to. Consists of a list of rules separated by comma.

        Available rules:

        1. Hostname pattern, for example: example.com, *.org:99, x.*.y.com, *foo.org.
        2. IP literal, for example: 127.0.0.1, 0.0.0.0:99, [::1], [0:0::1]:99.
        3. <loopback> that matches local loopback interfaces: localhost, *.localhost, 127.0.0.1, [::1].

        Some common examples:

        1. "*" to expose all network.
        2. "<loopback>" to expose localhost network.
        3. "*.test.internal-domain,*.staging.internal-domain,<loopback>" to expose test/staging deployments and localhost.
      • setHeaders

        public BrowserType.ConnectOptions setHeaders​(java.util.Map<java.lang.String,​java.lang.String> headers)
        Additional HTTP headers to be sent with web socket connect request. Optional.
      • setSlowMo

        public BrowserType.ConnectOptions setSlowMo​(double slowMo)
        Slows down Playwright operations by the specified amount of milliseconds. Useful so that you can see what is going on. Defaults to 0.
      • setTimeout

        public BrowserType.ConnectOptions setTimeout​(double timeout)
        Maximum time in milliseconds to wait for the connection to be established. Defaults to 0 (no timeout).