# frozen_string_literal: true # Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not use this file except in compliance # with the License. You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, # software distributed under the License is distributed on an # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY # KIND, either express or implied. See the License for the # specific language governing permissions and limitations # under the License. # This file is automatically generated. Any changes will be lost! module Selenium module DevTools module V101 class Browser EVENTS = { download_will_begin: 'downloadWillBegin', download_progress: 'downloadProgress', }.freeze def initialize(devtools) @devtools = devtools end def on(event, &block) event = EVENTS[event] if event.is_a?(Symbol) @devtools.callbacks["Browser.#{event}"] << block end def set_permission(permission:, setting:, origin: nil, browser_context_id: nil) @devtools.send_cmd('Browser.setPermission', permission: permission, setting: setting, origin: origin, browserContextId: browser_context_id) end def grant_permissions(permissions:, origin: nil, browser_context_id: nil) @devtools.send_cmd('Browser.grantPermissions', permissions: permissions, origin: origin, browserContextId: browser_context_id) end def reset_permissions(browser_context_id: nil) @devtools.send_cmd('Browser.resetPermissions', browserContextId: browser_context_id) end def set_download_behavior(behavior:, browser_context_id: nil, download_path: nil, events_enabled: nil) @devtools.send_cmd('Browser.setDownloadBehavior', behavior: behavior, browserContextId: browser_context_id, downloadPath: download_path, eventsEnabled: events_enabled) end def cancel_download(guid:, browser_context_id: nil) @devtools.send_cmd('Browser.cancelDownload', guid: guid, browserContextId: browser_context_id) end def close @devtools.send_cmd('Browser.close') end def crash @devtools.send_cmd('Browser.crash') end def crash_gpu_process @devtools.send_cmd('Browser.crashGpuProcess') end def get_version @devtools.send_cmd('Browser.getVersion') end def get_browser_command_line @devtools.send_cmd('Browser.getBrowserCommandLine') end def get_histograms(query: nil, delta: nil) @devtools.send_cmd('Browser.getHistograms', query: query, delta: delta) end def get_histogram(name:, delta: nil) @devtools.send_cmd('Browser.getHistogram', name: name, delta: delta) end def get_window_bounds(window_id:) @devtools.send_cmd('Browser.getWindowBounds', windowId: window_id) end def get_window_for_target(target_id: nil) @devtools.send_cmd('Browser.getWindowForTarget', targetId: target_id) end def set_window_bounds(window_id:, bounds:) @devtools.send_cmd('Browser.setWindowBounds', windowId: window_id, bounds: bounds) end def set_dock_tile(badge_label: nil, image: nil) @devtools.send_cmd('Browser.setDockTile', badgeLabel: badge_label, image: image) end def execute_browser_command(command_id:) @devtools.send_cmd('Browser.executeBrowserCommand', commandId: command_id) end end # Browser end # V101 end # DevTools end # Selenium