Class BrowserImpl

java.lang.Object
io.webfolder.cdp.command.BrowserImpl
All Implemented Interfaces:
Browser

public class BrowserImpl
extends java.lang.Object
implements Browser
  • Constructor Details

  • Method Details

    • setPermission

      public void setPermission​(java.lang.String origin, PermissionDescriptor permission, PermissionSetting setting, java.lang.String browserContextId)
      Description copied from interface: Browser
      Set permission settings for given origin.
      Specified by:
      setPermission in interface Browser
      Parameters:
      origin - Origin the permission applies to.
      permission - Descriptor of permission to override.
      setting - Setting of the permission.
      browserContextId - Context to override. When omitted, default browser context is used.
    • grantPermissions

      public void grantPermissions​(java.lang.String origin, PermissionType permissions, java.lang.String browserContextId)
      Description copied from interface: Browser
      Grant specific permissions to the given origin and reject all others.
      Specified by:
      grantPermissions in interface Browser
      browserContextId - BrowserContext to override permissions. When omitted, default browser context is used.
    • resetPermissions

      public void resetPermissions​(java.lang.String browserContextId)
      Description copied from interface: Browser
      Reset all permission management for all origins.
      Specified by:
      resetPermissions in interface Browser
      Parameters:
      browserContextId - BrowserContext to reset permissions. When omitted, default browser context is used.
    • close

      public void close()
      Description copied from interface: Browser
      Close browser gracefully.
      Specified by:
      close in interface Browser
    • crash

      public void crash()
      Description copied from interface: Browser
      Crashes browser on the main thread.
      Specified by:
      crash in interface Browser
    • crashGpuProcess

      public void crashGpuProcess()
      Description copied from interface: Browser
      Crashes GPU process.
      Specified by:
      crashGpuProcess in interface Browser
    • getVersion

      public GetVersionResult getVersion()
      Description copied from interface: Browser
      Returns version information.
      Specified by:
      getVersion in interface Browser
      Returns:
      GetVersionResult
    • getBrowserCommandLine

      public java.util.List<java.lang.String> getBrowserCommandLine()
      Description copied from interface: Browser
      Returns the command line switches for the browser process if, and only if --enable-automation is on the commandline.
      Specified by:
      getBrowserCommandLine in interface Browser
      Returns:
      Commandline parameters
    • getHistograms

      public java.util.List<Histogram> getHistograms​(java.lang.String query, java.lang.Boolean delta)
      Description copied from interface: Browser
      Get Chrome histograms.
      Specified by:
      getHistograms in interface Browser
      Parameters:
      query - Requested substring in name. Only histograms which have query as a substring in their name are extracted. An empty or absent query returns all histograms.
      delta - If true, retrieve delta since last call.
      Returns:
      Histograms.
    • getHistogram

      public Histogram getHistogram​(java.lang.String name, java.lang.Boolean delta)
      Description copied from interface: Browser
      Get a Chrome histogram by name.
      Specified by:
      getHistogram in interface Browser
      Parameters:
      name - Requested histogram name.
      delta - If true, retrieve delta since last call.
      Returns:
      Histogram.
    • getWindowBounds

      public Bounds getWindowBounds​(java.lang.Integer windowId)
      Description copied from interface: Browser
      Get position and size of the browser window.
      Specified by:
      getWindowBounds in interface Browser
      Parameters:
      windowId - Browser window id.
      Returns:
      Bounds information of the window. When window state is 'minimized', the restored window position and size are returned.
    • getWindowForTarget

      public GetWindowForTargetResult getWindowForTarget​(java.lang.String targetId)
      Description copied from interface: Browser
      Get the browser window that contains the devtools target.
      Specified by:
      getWindowForTarget in interface Browser
      Parameters:
      targetId - Devtools agent host id. If called as a part of the session, associated targetId is used.
      Returns:
      GetWindowForTargetResult
    • setWindowBounds

      public void setWindowBounds​(java.lang.Integer windowId, Bounds bounds)
      Description copied from interface: Browser
      Set position and/or size of the browser window.
      Specified by:
      setWindowBounds in interface Browser
      Parameters:
      windowId - Browser window id.
      bounds - New window bounds. The 'minimized', 'maximized' and 'fullscreen' states cannot be combined with 'left', 'top', 'width' or 'height'. Leaves unspecified fields unchanged.
    • setDockTile

      public void setDockTile​(java.lang.String badgeLabel, java.lang.String image)
      Description copied from interface: Browser
      Set dock tile details, platform-specific.
      Specified by:
      setDockTile in interface Browser
      image - Png encoded image.
    • setPermission

      public void setPermission​(java.lang.String origin, PermissionDescriptor permission, PermissionSetting setting)
      Description copied from interface: Browser
      Set permission settings for given origin.
      Specified by:
      setPermission in interface Browser
      Parameters:
      origin - Origin the permission applies to.
      permission - Descriptor of permission to override.
      setting - Setting of the permission.
    • grantPermissions

      public void grantPermissions​(java.lang.String origin, PermissionType permissions)
      Description copied from interface: Browser
      Grant specific permissions to the given origin and reject all others.
      Specified by:
      grantPermissions in interface Browser
    • resetPermissions

      public void resetPermissions()
      Description copied from interface: Browser
      Reset all permission management for all origins.
      Specified by:
      resetPermissions in interface Browser
    • getHistograms

      public java.util.List<Histogram> getHistograms()
      Description copied from interface: Browser
      Get Chrome histograms.
      Specified by:
      getHistograms in interface Browser
      Returns:
      Histograms.
    • getHistogram

      public Histogram getHistogram​(java.lang.String name)
      Description copied from interface: Browser
      Get a Chrome histogram by name.
      Specified by:
      getHistogram in interface Browser
      Parameters:
      name - Requested histogram name.
      Returns:
      Histogram.
    • getWindowForTarget

      public GetWindowForTargetResult getWindowForTarget()
      Description copied from interface: Browser
      Get the browser window that contains the devtools target.
      Specified by:
      getWindowForTarget in interface Browser
      Returns:
      GetWindowForTargetResult
    • setDockTile

      public void setDockTile()
      Description copied from interface: Browser
      Set dock tile details, platform-specific.
      Specified by:
      setDockTile in interface Browser