Path: blob/trunk/py/selenium/webdriver/firefox/remote_connection.py
3991 views
# Licensed to the Software Freedom Conservancy (SFC) under one1# or more contributor license agreements. See the NOTICE file2# distributed with this work for additional information3# regarding copyright ownership. The SFC licenses this file4# to you under the Apache License, Version 2.0 (the5# "License"); you may not use this file except in compliance6# with the License. You may obtain a copy of the License at7#8# http://www.apache.org/licenses/LICENSE-2.09#10# Unless required by applicable law or agreed to in writing,11# software distributed under the License is distributed on an12# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY13# KIND, either express or implied. See the License for the14# specific language governing permissions and limitations15# under the License.161718from selenium.webdriver.common.desired_capabilities import DesiredCapabilities19from selenium.webdriver.remote.client_config import ClientConfig20from selenium.webdriver.remote.remote_connection import RemoteConnection212223class FirefoxRemoteConnection(RemoteConnection):24browser_name = DesiredCapabilities.FIREFOX["browserName"] # type: ignore2526def __init__(27self,28remote_server_addr: str,29keep_alive: bool = True,30ignore_proxy: bool = False,31client_config: ClientConfig | None = None,32) -> None:33client_config = client_config or ClientConfig(34remote_server_addr=remote_server_addr, keep_alive=keep_alive, timeout=12035)36super().__init__(37ignore_proxy=ignore_proxy,38client_config=client_config,39)4041self._commands["GET_CONTEXT"] = ("GET", "/session/$sessionId/moz/context")42self._commands["SET_CONTEXT"] = ("POST", "/session/$sessionId/moz/context")43self._commands["INSTALL_ADDON"] = ("POST", "/session/$sessionId/moz/addon/install")44self._commands["UNINSTALL_ADDON"] = ("POST", "/session/$sessionId/moz/addon/uninstall")45self._commands["FULL_PAGE_SCREENSHOT"] = ("GET", "/session/$sessionId/moz/screenshot/full")464748