@@ -27,6 +27,7 @@ class ChromiumOptions(ArgOptions):
2727 KEY = "goog:chromeOptions"
2828
2929 def __init__ (self ) -> None :
30+ """Initialize ChromiumOptions with default settings."""
3031 super ().__init__ ()
3132 self ._binary_location : str = ""
3233 self ._extension_files : list [str ] = []
@@ -37,42 +38,46 @@ def __init__(self) -> None:
3738
3839 @property
3940 def binary_location (self ) -> str :
40- """:Returns: The location of the binary, otherwise an empty string."""
41+ """Returns:
42+ The location of the binary, otherwise an empty string.
43+ """
4144 return self ._binary_location
4245
4346 @binary_location .setter
4447 def binary_location (self , value : str ) -> None :
4548 """Allows you to set where the chromium binary lives.
4649
47- Parameters:
48- ----------
49- value: path to the Chromium binary
50+ Args:
51+ value: Path to the Chromium binary.
5052 """
5153 if not isinstance (value , str ):
5254 raise TypeError (self .BINARY_LOCATION_ERROR )
5355 self ._binary_location = value
5456
5557 @property
5658 def debugger_address (self ) -> Optional [str ]:
57- """:Returns: The address of the remote devtools instance."""
59+ """Returns:
60+ The address of the remote devtools instance.
61+ """
5862 return self ._debugger_address
5963
6064 @debugger_address .setter
6165 def debugger_address (self , value : str ) -> None :
6266 """Allows you to set the address of the remote devtools instance that
6367 the ChromeDriver instance will try to connect to during an active wait.
6468
65- Parameters:
66- ----------
67- value: address of remote devtools instance if any (hostname[:port])
69+ Args:
70+ value: Address of remote devtools instance if any (hostname[:port]).
6871 """
6972 if not isinstance (value , str ):
7073 raise TypeError ("Debugger Address must be a string" )
7174 self ._debugger_address = value
7275
7376 @property
7477 def extensions (self ) -> list [str ]:
75- """:Returns: A list of encoded extensions that will be loaded."""
78+ """Returns:
79+ A list of encoded extensions that will be loaded.
80+ """
7681
7782 def _decode (file_data : BinaryIO ) -> str :
7883 # Should not use base64.encodestring() which inserts newlines every
@@ -91,9 +96,8 @@ def add_extension(self, extension: str) -> None:
9196 """Adds the path to the extension to a list that will be used to
9297 extract it to the ChromeDriver.
9398
94- Parameters:
95- ----------
96- extension: path to the \\ *.crx file
99+ Args:
100+ extension: Path to the \\ *.crx file.
97101 """
98102 if extension :
99103 extension_to_add = os .path .abspath (os .path .expanduser (extension ))
@@ -108,9 +112,8 @@ def add_encoded_extension(self, extension: str) -> None:
108112 """Adds Base64 encoded string with extension data to a list that will
109113 be used to extract it to the ChromeDriver.
110114
111- Parameters:
112- ----------
113- extension: Base64 encoded string with extension data
115+ Args:
116+ extension: Base64 encoded string with extension data.
114117 """
115118 if extension :
116119 self ._extensions .append (extension )
@@ -119,45 +122,44 @@ def add_encoded_extension(self, extension: str) -> None:
119122
120123 @property
121124 def experimental_options (self ) -> dict :
122- """:Returns: A dictionary of experimental options for chromium."""
125+ """Returns:
126+ A dictionary of experimental options for chromium.
127+ """
123128 return self ._experimental_options
124129
125130 def add_experimental_option (self , name : str , value : Union [str , int , dict , list [str ]]) -> None :
126131 """Adds an experimental option which is passed to chromium.
127132
128- Parameters:
129- ----------
130- name: The experimental option name.
131- value: The option value.
133+ Args:
134+ name: The experimental option name.
135+ value: The option value.
132136 """
133137 self ._experimental_options [name ] = value
134138
135139 @property
136140 def enable_webextensions (self ) -> bool :
137- """:Returns: Whether webextension support is enabled for Chromium-based browsers.
138- True if webextension support is enabled, False otherwise.
141+ """Returns:
142+ Whether webextension support is enabled for Chromium-based browsers.
143+ True if webextension support is enabled, False otherwise.
139144 """
140145 return self ._enable_webextensions
141146
142147 @enable_webextensions .setter
143148 def enable_webextensions (self , value : bool ) -> None :
144149 """Enables or disables webextension support for Chromium-based browsers.
145150
146- Parameters:
147- ----------
148- value : bool
149- True to enable webextension support, False to disable.
151+ Args:
152+ value: True to enable webextension support, False to disable.
150153
151154 Notes:
152- -----
153- - When enabled, this automatically adds the required Chromium flags:
154- - --enable-unsafe-extension-debugging
155- - --remote-debugging-pipe
156- - When disabled, this removes BOTH flags listed above, even if they were manually added via add_argument()
157- before enabling webextensions.
158- - Enabling --remote-debugging-pipe makes the connection b/w chromedriver
159- and the browser use a pipe instead of a port, disabling many CDP functionalities
160- like devtools
155+ - When enabled, this automatically adds the required Chromium flags:
156+ - --enable-unsafe-extension-debugging
157+ - --remote-debugging-pipe
158+ - When disabled, this removes BOTH flags listed above, even if they were manually added via add_argument()
159+ before enabling webextensions.
160+ - Enabling --remote-debugging-pipe makes the connection b/w chromedriver
161+ and the browser use a pipe instead of a port, disabling many CDP functionalities
162+ like devtools
161163 """
162164 self ._enable_webextensions = value
163165 if value :
@@ -174,11 +176,10 @@ def enable_webextensions(self, value: bool) -> None:
174176 self ._arguments .remove (flag )
175177
176178 def to_capabilities (self ) -> dict :
177- """Creates a capabilities with all the options that have been set
179+ """Creates a capabilities with all the options that have been set.
178180
179181 Returns:
180- -------
181- dict : a dictionary with all set options
182+ A dictionary with all set options.
182183 """
183184 caps = self ._caps
184185 chrome_options = self .experimental_options .copy ()
0 commit comments