Class SessionFactory

java.lang.Object
io.webfolder.cdp.session.SessionFactory
All Implemented Interfaces:
java.lang.AutoCloseable

public class SessionFactory
extends java.lang.Object
implements java.lang.AutoCloseable
  • Constructor Details

  • Method Details

    • connect

      public void connect()
    • create

      public Session create()
      Creates a new page
      Returns:
      this
    • create

      public Session create​(SessionSettings settings)
      Creates a new page
      Parameters:
      settings -
      Returns:
      this
    • create

      public Session create​(java.lang.String browserContextId)
      Creates a new page
      Parameters:
      browserContextId - incognito browser context id
      Returns:
      this
    • create

      public Session create​(java.lang.String browserContextId, SessionSettings settings)
      Creates a new page
      Parameters:
      browserContextId - incognito browser context id
      settings -
      Returns:
      this
    • connect

      public Session connect​(java.lang.String targetId)
      Connect to existing session
      Returns:
      this
    • getMajorVersion

      public int getMajorVersion()
      Get major version of the browser.
      Returns:
      major version number
    • close

      public void close()
      Closes all sessions. The factory object itself is considered disposed and cannot be used anymore.
      Specified by:
      close in interface java.lang.AutoCloseable
    • activate

      public void activate​(java.lang.String sessionId)
      Activate this browser window
      Parameters:
      sessionId - session identifier
    • isHeadless

      public boolean isHeadless()
      Tests whether or not a Browser launched with headless argument.
      Returns:
      true if browser launched with headless argument.
    • createBrowserContext

      public java.lang.String createBrowserContext()
      Creates a new incognito browser context. This won't share cookies/cache with other browser contexts.
    • disposeBrowserContext

      public void disposeBrowserContext​(java.lang.String browserContextId)
      Dispose incoginto browser context.
    • closed

      public boolean closed()
    • createLoggerFactory

      protected LoggerFactory createLoggerFactory​(CdpLoggerType loggerType)
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object