Class Launcher

java.lang.Object
io.webfolder.cdp.Launcher

public class Launcher extends Object
A class that is able to create and launch a browser instance. If you launch the browser externally, use DevToolsConnection or DevToolsProfileConnection class to connect via a WebSocket connection.
  • Constructor Details

  • Method Details

    • findChrome

      protected String findChrome()
    • findChromeWinPath

      protected String findChromeWinPath()
    • isChromeInstalled

      public boolean isChromeInstalled()
      Tests whether chrome/chromium is installed.
      Returns:
      true if browser is found on predefined paths
    • getChromeWinPaths

      protected List<String> getChromeWinPaths()
    • findChromeOsxPath

      protected String findChromeOsxPath()
    • getChromeOsxPaths

      protected List<String> getChromeOsxPaths()
    • getCommonParameters

      protected List<String> getCommonParameters(String chromeExecutablePath, List<String> arguments)
    • toString

      protected String toString(InputStream is)
    • launch

      public SessionFactory launch()
    • isInUse

      protected boolean isInUse(Path userDataDir)
      Read the DevToolsActivePort file, which contains the WebSocket port.
      Returns:
      true if the WebSocket connection is in use.
    • launchWithLibUv

      protected SessionFactory launchWithLibUv(List<String> arguments)
    • launchWithProcessBuilder

      protected SessionFactory launchWithProcessBuilder(List<String> arguments)
    • kill

      public boolean kill()
      Closes the SessionFactory and kills the Browser process.
      Returns:
      true if the process is terminated successfully.
    • getOptions

      public Options getOptions()
    • getUserDataDir

      public Path getUserDataDir()