"Fossies" - the Fresh Open Source Software Archive 
Member "selenium-selenium-4.8.1/py/selenium/webdriver/chromium/remote_connection.py" (17 Feb 2023, 2604 Bytes) of package /linux/www/selenium-selenium-4.8.1.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style:
standard) with prefixed line numbers.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "remote_connection.py" see the
Fossies "Dox" file reference documentation and the last
Fossies "Diffs" side-by-side code changes report:
4.7.0_vs_4.8.0.
1 # Licensed to the Software Freedom Conservancy (SFC) under one
2 # or more contributor license agreements. See the NOTICE file
3 # distributed with this work for additional information
4 # regarding copyright ownership. The SFC licenses this file
5 # to you under the Apache License, Version 2.0 (the
6 # "License"); you may not use this file except in compliance
7 # with the License. You may obtain a copy of the License at
8 #
9 # http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing,
12 # software distributed under the License is distributed on an
13 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14 # KIND, either express or implied. See the License for the
15 # specific language governing permissions and limitations
16 # under the License.
17 import typing
18
19 from selenium.webdriver.remote.remote_connection import RemoteConnection
20
21
22 class ChromiumRemoteConnection(RemoteConnection):
23 def __init__(
24 self,
25 remote_server_addr: str,
26 vendor_prefix: str,
27 browser_name: str,
28 keep_alive: bool = True,
29 ignore_proxy: typing.Optional[bool] = False,
30 ) -> None:
31 super().__init__(remote_server_addr, keep_alive, ignore_proxy=ignore_proxy)
32 self.browser_name = browser_name
33 self._commands["launchApp"] = ("POST", "/session/$sessionId/chromium/launch_app")
34 self._commands["setPermissions"] = ("POST", "/session/$sessionId/permissions")
35 self._commands["setNetworkConditions"] = ("POST", "/session/$sessionId/chromium/network_conditions")
36 self._commands["getNetworkConditions"] = ("GET", "/session/$sessionId/chromium/network_conditions")
37 self._commands["deleteNetworkConditions"] = ("DELETE", "/session/$sessionId/chromium/network_conditions")
38 self._commands["executeCdpCommand"] = ("POST", f"/session/$sessionId/{vendor_prefix}/cdp/execute")
39 self._commands["getSinks"] = ("GET", f"/session/$sessionId/{vendor_prefix}/cast/get_sinks")
40 self._commands["getIssueMessage"] = ("GET", f"/session/$sessionId/{vendor_prefix}/cast/get_issue_message")
41 self._commands["setSinkToUse"] = ("POST", f"/session/$sessionId/{vendor_prefix}/cast/set_sink_to_use")
42 self._commands["startDesktopMirroring"] = (
43 "POST",
44 f"/session/$sessionId/{vendor_prefix}/cast/start_desktop_mirroring",
45 )
46 self._commands["startTabMirroring"] = ("POST", f"/session/$sessionId/{vendor_prefix}/cast/start_tab_mirroring")
47 self._commands["stopCasting"] = ("POST", f"/session/$sessionId/{vendor_prefix}/cast/stop_casting")