Class Browser


  • public class Browser
    extends java.lang.Object
    The Browser domain defines methods and events for browser managing.
    • Constructor Detail

      • Browser

        public Browser()
    • Method Detail

      • grantPermissions

        @Beta
        public static Command<java.lang.Void> grantPermissions​(java.lang.String origin,
                                                               java.util.List<PermissionType> permissions,
                                                               java.util.Optional<BrowserContextID> browserContextId)
        Grant specific permissions to the given origin and reject all others.
      • resetPermissions

        @Beta
        public static Command<java.lang.Void> resetPermissions​(java.util.Optional<BrowserContextID> browserContextId)
        Reset all permission management for all origins.
      • close

        public static Command<java.lang.Void> close()
        Close browser gracefully.
      • crash

        @Beta
        public static Command<java.lang.Void> crash()
        Crashes browser on the main thread.
      • crashGpuProcess

        @Beta
        public static Command<java.lang.Void> crashGpuProcess()
        Crashes GPU process.
      • getBrowserCommandLine

        @Beta
        public static Command<java.util.List<java.lang.String>> getBrowserCommandLine()
        Returns the command line switches for the browser process if, and only if --enable-automation is on the commandline.
      • getHistograms

        @Beta
        public static Command<java.util.List<Histogram>> getHistograms​(java.util.Optional<java.lang.String> query,
                                                                       java.util.Optional<java.lang.Boolean> delta)
        Get Chrome histograms.
      • getHistogram

        @Beta
        public static Command<Histogram> getHistogram​(java.lang.String name,
                                                      java.util.Optional<java.lang.Boolean> delta)
        Get a Chrome histogram by name.
      • getWindowBounds

        @Beta
        public static Command<Bounds> getWindowBounds​(WindowID windowId)
        Get position and size of the browser window.
      • setWindowBounds

        @Beta
        public static Command<java.lang.Void> setWindowBounds​(WindowID windowId,
                                                              Bounds bounds)
        Set position and/or size of the browser window.
      • setDockTile

        @Beta
        public static Command<java.lang.Void> setDockTile​(java.util.Optional<java.lang.String> badgeLabel,
                                                          java.util.Optional<java.lang.String> image)
        Set dock tile details, platform-specific.