forked from nwjs/nw.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselenium.patch
More file actions
46 lines (42 loc) · 1.43 KB
/
selenium.patch
File metadata and controls
46 lines (42 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
diff --git a/selenium/webdriver/chrome/options.py b/selenium/webdriver/chrome/options.py
index 102ecb8..36e6025 100644
--- selenium/webdriver/chrome/options.py
+++ selenium/webdriver/chrome/options.py
@@ -25,6 +25,7 @@ class Options(object):
def __init__(self):
self._binary_location = ''
self._arguments = []
+ self._nw_arguments = []
self._extension_files = []
self._experimental_options = {}
@@ -65,6 +66,25 @@ class Options(object):
raise ValueError("argument can not be null")
@property
+ def nw_arguments(self):
+ """
+ Returns a list of arguments needed for the browser
+ """
+ return self._nw_arguments
+
+ def add_nw_argument(self, argument):
+ """
+ Adds an argument to the list
+
+ :Args:
+ - Sets the arguments
+ """
+ if argument:
+ self._nw_arguments.append(argument)
+ else:
+ raise ValueError("argument can not be null")
+
+ @property
def extensions(self):
"""
Returns a list of encoded extensions that will be loaded into chrome
@@ -126,6 +146,7 @@ class Options(object):
chrome_options["extensions"] = self.extensions
chrome_options["binary"] = self.binary_location
chrome_options["args"] = self.arguments
+ chrome_options["nwargs"] = self.nw_arguments
chrome["chromeOptions"] = chrome_options