@@ -44,8 +44,9 @@ def binary_location(self) -> str:
44
44
def binary_location (self , value : str ) -> None :
45
45
"""Allows you to set where the chromium binary lives.
46
46
47
- :Args:
48
- - value: path to the Chromium binary
47
+ Parameters:
48
+ ----------
49
+ value: path to the Chromium binary
49
50
"""
50
51
if not isinstance (value , str ):
51
52
raise TypeError (self .BINARY_LOCATION_ERROR )
@@ -61,8 +62,9 @@ def debugger_address(self, value: str) -> None:
61
62
"""Allows you to set the address of the remote devtools instance that
62
63
the ChromeDriver instance will try to connect to during an active wait.
63
64
64
- :Args:
65
- - value: address of remote devtools instance if any (hostname[:port])
65
+ Parameters:
66
+ ----------
67
+ value: address of remote devtools instance if any (hostname[:port])
66
68
"""
67
69
if not isinstance (value , str ):
68
70
raise TypeError ("Debugger Address must be a string" )
@@ -89,8 +91,9 @@ def add_extension(self, extension: str) -> None:
89
91
"""Adds the path to the extension to a list that will be used to
90
92
extract it to the ChromeDriver.
91
93
92
- :Args:
93
- - extension: path to the \\ *.crx file
94
+ Parameters:
95
+ ----------
96
+ extension: path to the \\ *.crx file
94
97
"""
95
98
if extension :
96
99
extension_to_add = os .path .abspath (os .path .expanduser (extension ))
@@ -105,8 +108,9 @@ def add_encoded_extension(self, extension: str) -> None:
105
108
"""Adds Base64 encoded string with extension data to a list that will
106
109
be used to extract it to the ChromeDriver.
107
110
108
- :Args:
109
- - extension: Base64 encoded string with extension data
111
+ Parameters:
112
+ ----------
113
+ extension: Base64 encoded string with extension data
110
114
"""
111
115
if extension :
112
116
self ._extensions .append (extension )
@@ -121,30 +125,37 @@ def experimental_options(self) -> dict:
121
125
def add_experimental_option (self , name : str , value : Union [str , int , dict , list [str ]]) -> None :
122
126
"""Adds an experimental option which is passed to chromium.
123
127
124
- :Args:
128
+ Parameters:
129
+ ----------
125
130
name: The experimental option name.
126
131
value: The option value.
127
132
"""
128
133
self ._experimental_options [name ] = value
129
134
130
135
@property
131
136
def enable_webextensions (self ) -> bool :
132
- """Returns whether webextension support is enabled for Chromium-based browsers.
133
-
134
- :Returns: True if webextension support is enabled, False otherwise.
137
+ """:Returns: Whether webextension support is enabled for Chromium-based browsers.
138
+ True if webextension support is enabled, False otherwise.
135
139
"""
136
140
return self ._enable_webextensions
137
141
138
142
@enable_webextensions .setter
139
143
def enable_webextensions (self , value : bool ) -> None :
140
144
"""Enables or disables webextension support for Chromium-based browsers.
141
145
142
- When enabled, this automatically adds the required Chromium flags:
143
- - --enable-unsafe-extension-debugging
144
- - --remote-debugging-pipe
145
-
146
- :Args:
147
- - value: True to enable webextension support, False to disable.
146
+ Parameters:
147
+ ----------
148
+ value : bool
149
+ True to enable webextension support, False to disable.
150
+
151
+ Notes:
152
+ -----
153
+ - When enabled, this automatically adds the required Chromium flags:
154
+ - --enable-unsafe-extension-debugging
155
+ - --remote-debugging-pipe
156
+ - Enabling --remote-debugging-pipe makes the connection b/w chromedriver
157
+ and the browser use a pipe instead of a port, disabling many CDP functionalities
158
+ like devtools
148
159
"""
149
160
self ._enable_webextensions = value
150
161
if value :
@@ -162,7 +173,11 @@ def enable_webextensions(self, value: bool) -> None:
162
173
163
174
def to_capabilities (self ) -> dict :
164
175
"""Creates a capabilities with all the options that have been set
165
- :Returns: A dictionary with everything."""
176
+
177
+ Returns:
178
+ -------
179
+ dict : a dictionary with all set options
180
+ """
166
181
caps = self ._caps
167
182
chrome_options = self .experimental_options .copy ()
168
183
if self .mobile_options :
0 commit comments