selenium-webdriver 4.0.0-alpha.3 → 4.0.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGES.md +9 -2
- package/README.md +2 -4
- package/chrome.js +19 -527
- package/chromium.js +762 -0
- package/edge.js +97 -58
- package/firefox.js +23 -5
- package/http/index.js +4 -0
- package/io/index.js +1 -1
- package/lib/actions.js +1 -1
- package/lib/atoms/get-attribute.js +1 -2
- package/lib/atoms/is-displayed.js +5 -6
- package/lib/atoms/make-atoms-module.js +17 -0
- package/lib/capabilities.js +17 -4
- package/lib/command.js +1 -0
- package/lib/http.js +8 -3
- package/lib/input.js +6 -6
- package/lib/logging.js +1 -1
- package/lib/webdriver.js +33 -3
- package/net/portprober.js +1 -1
- package/package.json +8 -9
- package/BUILD.bazel +0 -88
- package/example/chrome_android.js +0 -42
- package/example/chrome_mobile_emulation.js +0 -42
- package/example/firefox_channels.js +0 -77
- package/example/google_search.js +0 -50
- package/example/google_search_test.js +0 -72
- package/example/headless.js +0 -55
- package/example/logging.js +0 -68
- package/jasmine.json +0 -11
- package/lib/atoms/BUILD.bazel +0 -28
- package/lib/test/bootstrap_jasmine.js +0 -28
- package/lib/test/build.js +0 -156
- package/lib/test/data/actions/click.html +0 -24
- package/lib/test/data/actions/drag.html +0 -77
- package/lib/test/data/actions/record_click.html +0 -21
- package/lib/test/data/chrome/download.html +0 -2
- package/lib/test/data/firefox/webextension.xpi +0 -0
- package/lib/test/fileserver.js +0 -337
- package/lib/test/httpserver.js +0 -120
- package/lib/test/index.js +0 -87
- package/lib/test/resources.js +0 -40
- package/test/actions_test.js +0 -206
- package/test/builder_test.js +0 -106
- package/test/chrome/devtools_test.js +0 -93
- package/test/chrome/options_test.js +0 -121
- package/test/chrome/service_test.js +0 -45
- package/test/cookie_test.js +0 -210
- package/test/element_finding_test.js +0 -431
- package/test/execute_script_test.js +0 -355
- package/test/fingerprint_test.js +0 -63
- package/test/firefox_test.js +0 -233
- package/test/frame_test.js +0 -45
- package/test/http/http_test.js +0 -229
- package/test/http/util_test.js +0 -178
- package/test/io/io_test.js +0 -364
- package/test/io/zip_test.js +0 -126
- package/test/lib/by_test.js +0 -160
- package/test/lib/capabilities_test.js +0 -129
- package/test/lib/error_test.js +0 -333
- package/test/lib/http_test.js +0 -576
- package/test/lib/input_test.js +0 -1379
- package/test/lib/logging_test.js +0 -272
- package/test/lib/promise_test.js +0 -674
- package/test/lib/testutil.js +0 -90
- package/test/lib/until_test.js +0 -478
- package/test/lib/webdriver_test.js +0 -1692
- package/test/logging_test.js +0 -160
- package/test/net/index_test.js +0 -60
- package/test/net/portprober_test.js +0 -128
- package/test/page_loading_test.js +0 -156
- package/test/proxy_test.js +0 -167
- package/test/rect_test.js +0 -51
- package/test/remote_test.js +0 -98
- package/test/safari_test.js +0 -44
- package/test/stale_element_test.js +0 -60
- package/test/upload_test.js +0 -78
- package/test/window_test.js +0 -168
- package/testing/index.js +0 -498
- package/tools/init_jasmine.js +0 -7
package/edge.js
CHANGED
|
@@ -17,26 +17,37 @@
|
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* @fileoverview Defines a {@linkplain Driver WebDriver} client for
|
|
20
|
-
* Microsoft's Edge web browser.
|
|
21
|
-
* you must download and install the
|
|
22
|
-
* [
|
|
23
|
-
*
|
|
24
|
-
*
|
|
20
|
+
* Microsoft's Edge web browser. Both Edge (Chromium), and Edge Legacy (EdgeHTML) are
|
|
21
|
+
* supported. Before using this module, you must download and install the correct
|
|
22
|
+
* [WebDriver](https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/)
|
|
23
|
+
* server.
|
|
24
|
+
*
|
|
25
|
+
* Ensure that the either MicrosoftWebDriver (EdgeHTML) or msedgedriver (Chromium)
|
|
26
|
+
* is on your [PATH](http://en.wikipedia.org/wiki/PATH_%28variable%29). MicrosoftWebDriver
|
|
27
|
+
* and Edge Legacy (EdgeHTML) will be used by default.
|
|
28
|
+
*
|
|
29
|
+
* You may use {@link Options} to specify whether Edge Chromium should be used:
|
|
30
|
+
|
|
31
|
+
* var options = new edge.Options();
|
|
32
|
+
* options.useEdgeChromium(true);
|
|
33
|
+
* // configure browser options ...
|
|
34
|
+
|
|
35
|
+
* Note that Chromium-specific {@link Options} will be ignored when using Edge Legacy.
|
|
25
36
|
*
|
|
26
37
|
* There are three primary classes exported by this module:
|
|
27
38
|
*
|
|
28
39
|
* 1. {@linkplain ServiceBuilder}: configures the
|
|
29
40
|
* {@link ./remote.DriverService remote.DriverService}
|
|
30
|
-
* that manages the [
|
|
41
|
+
* that manages the [WebDriver] child process.
|
|
31
42
|
*
|
|
32
43
|
* 2. {@linkplain Options}: defines configuration options for each new
|
|
33
|
-
*
|
|
44
|
+
* WebDriver session, such as which
|
|
34
45
|
* {@linkplain Options#setProxy proxy} to use when starting the browser.
|
|
35
46
|
*
|
|
36
47
|
* 3. {@linkplain Driver}: the WebDriver client; each new instance will control
|
|
37
48
|
* a unique browser session.
|
|
38
49
|
*
|
|
39
|
-
* __Customizing the
|
|
50
|
+
* __Customizing the WebDriver Server__ <a id="custom-server"></a>
|
|
40
51
|
*
|
|
41
52
|
* By default, every MicrosoftEdge session will use a single driver service,
|
|
42
53
|
* which is started the first time a {@link Driver} instance is created and
|
|
@@ -65,89 +76,110 @@
|
|
|
65
76
|
* operation, users should start MicrosoftEdge using the
|
|
66
77
|
* {@link ./builder.Builder selenium-webdriver.Builder}.
|
|
67
78
|
*
|
|
68
|
-
* [
|
|
79
|
+
* [WebDriver (EdgeHTML)]: https://docs.microsoft.com/en-us/microsoft-edge/webdriver
|
|
80
|
+
* [WebDriver (Chromium)]: https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium
|
|
69
81
|
*/
|
|
70
82
|
|
|
71
83
|
'use strict';
|
|
72
84
|
|
|
73
|
-
const fs = require('fs');
|
|
74
|
-
const util = require('util');
|
|
75
|
-
|
|
76
85
|
const http = require('./http');
|
|
77
86
|
const io = require('./io');
|
|
78
|
-
const portprober = require('./net/portprober');
|
|
79
|
-
const promise = require('./lib/promise');
|
|
80
87
|
const remote = require('./remote');
|
|
81
|
-
const Symbols = require('./lib/symbols');
|
|
82
88
|
const webdriver = require('./lib/webdriver');
|
|
83
89
|
const {Browser, Capabilities} = require('./lib/capabilities');
|
|
90
|
+
const chromium = require('./chromium');
|
|
84
91
|
|
|
85
|
-
const
|
|
86
|
-
|
|
92
|
+
const EDGE_CHROMIUM_BROWSER_NAME = "msedge";
|
|
93
|
+
const EDGEDRIVER_LEGACY_EXE = 'MicrosoftWebDriver.exe';
|
|
94
|
+
const EDGEDRIVER_CHROMIUM_EXE =
|
|
95
|
+
process.platform === 'win32' ? 'msedgedriver.exe' : 'msedgedriver';
|
|
87
96
|
|
|
88
97
|
/**
|
|
89
|
-
* _Synchronously_ attempts to locate the
|
|
90
|
-
* system.
|
|
98
|
+
* _Synchronously_ attempts to locate the Edge driver executable
|
|
99
|
+
* on the current system. Searches for the legacy MicrosoftWebDriver by default.
|
|
91
100
|
*
|
|
101
|
+
* @param {string=} browserName Name of the Edge driver executable to locate.
|
|
102
|
+
* May be either 'msedge' to locate the Edge Chromium driver, or 'MicrosoftEdge' to
|
|
103
|
+
* locate the Edge Legacy driver. If omitted, will attempt to locate Edge Legacy.
|
|
92
104
|
* @return {?string} the located executable, or `null`.
|
|
93
105
|
*/
|
|
94
|
-
function locateSynchronously() {
|
|
106
|
+
function locateSynchronously(browserName) {
|
|
107
|
+
browserName = browserName || Browser.EDGE;
|
|
108
|
+
|
|
109
|
+
if (browserName === EDGE_CHROMIUM_BROWSER_NAME) {
|
|
110
|
+
return io.findInPath(EDGEDRIVER_CHROMIUM_EXE, true);
|
|
111
|
+
}
|
|
112
|
+
|
|
95
113
|
return process.platform === 'win32'
|
|
96
|
-
? io.findInPath(
|
|
114
|
+
? io.findInPath(EDGEDRIVER_LEGACY_EXE, true) : null;
|
|
97
115
|
}
|
|
98
116
|
|
|
99
117
|
|
|
100
118
|
/**
|
|
101
|
-
* Class for managing
|
|
119
|
+
* Class for managing Edge specific options.
|
|
102
120
|
*/
|
|
103
|
-
class Options extends
|
|
121
|
+
class Options extends chromium.Options {
|
|
104
122
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
123
|
+
* Instruct the EdgeDriver to use Edge Chromium if true.
|
|
124
|
+
* Otherwise, use Edge Legacy (EdgeHTML). Defaults to using Edge Legacy.
|
|
125
|
+
*
|
|
126
|
+
* @param {boolean} useEdgeChromium
|
|
127
|
+
* @return {!Options} A self reference.
|
|
107
128
|
*/
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
this
|
|
129
|
+
setEdgeChromium(useEdgeChromium) {
|
|
130
|
+
this.set(Options.USE_EDGE_CHROMIUM, !!useEdgeChromium);
|
|
131
|
+
return this;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
Options.USE_EDGE_CHROMIUM = 'ms:edgeChromium';
|
|
136
|
+
Options.prototype.BROWSER_NAME_VALUE = Browser.EDGE;
|
|
137
|
+
Options.prototype.CAPABILITY_KEY = 'ms:edgeOptions';
|
|
138
|
+
Options.prototype.VENDOR_CAPABILITY_PREFIX = 'ms';
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* @param {(Capabilities|Object<string, *>)=} o The options object
|
|
142
|
+
* @return {boolean}
|
|
143
|
+
*/
|
|
144
|
+
function useEdgeChromium(o) {
|
|
145
|
+
if (o instanceof Capabilities) {
|
|
146
|
+
return !!o.get(Options.USE_EDGE_CHROMIUM);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
if (o && typeof o === 'object') {
|
|
150
|
+
return !!o[Options.USE_EDGE_CHROMIUM];
|
|
111
151
|
}
|
|
152
|
+
|
|
153
|
+
return false;
|
|
112
154
|
}
|
|
113
155
|
|
|
114
156
|
|
|
115
157
|
/**
|
|
116
158
|
* Creates {@link remote.DriverService} instances that manage a
|
|
117
|
-
*
|
|
159
|
+
* WebDriver server in a child process. Used for driving both
|
|
160
|
+
* Microsoft Edge Legacy and Chromium. A ServiceBuilder constructed
|
|
161
|
+
* with default parameters will launch a MicrosoftWebDriver child
|
|
162
|
+
* process for driving Edge Legacy. You may pass in a path to
|
|
163
|
+
* msedgedriver.exe to use Edge Chromium instead.
|
|
118
164
|
*/
|
|
119
|
-
class ServiceBuilder extends
|
|
165
|
+
class ServiceBuilder extends chromium.ServiceBuilder {
|
|
120
166
|
/**
|
|
121
167
|
* @param {string=} opt_exe Path to the server executable to use. If omitted,
|
|
122
|
-
* the builder will attempt to locate
|
|
168
|
+
* the builder will attempt to locate MicrosoftWebDriver on the current
|
|
123
169
|
* PATH.
|
|
124
170
|
* @throws {Error} If provided executable does not exist, or the
|
|
125
|
-
*
|
|
171
|
+
* MicrosoftWebDriver cannot be found on the PATH.
|
|
126
172
|
*/
|
|
127
173
|
constructor(opt_exe) {
|
|
128
174
|
let exe = opt_exe || locateSynchronously();
|
|
129
175
|
if (!exe) {
|
|
130
|
-
throw Error(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
'ensure it can be found on your PATH.');
|
|
176
|
+
throw Error('The WebDriver for Edge could not be found on the current PATH. Please ' +
|
|
177
|
+
'download the latest version of ' + EDGEDRIVER_LEGACY_EXE + ' from ' +
|
|
178
|
+
'https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/ and ' +
|
|
179
|
+
'ensure it can be found on your PATH.');
|
|
135
180
|
}
|
|
136
181
|
|
|
137
182
|
super(exe);
|
|
138
|
-
|
|
139
|
-
// Binding to the loopback address will fail if not running with
|
|
140
|
-
// administrator privileges. Since we cannot test for that in script
|
|
141
|
-
// (or can we?), force the DriverService to use "localhost".
|
|
142
|
-
this.setHostname('localhost');
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Enables verbose logging.
|
|
147
|
-
* @return {!ServiceBuilder} A self reference.
|
|
148
|
-
*/
|
|
149
|
-
enableVerboseLogging() {
|
|
150
|
-
return this.addArguments('--verbose');
|
|
151
183
|
}
|
|
152
184
|
}
|
|
153
185
|
|
|
@@ -157,7 +189,7 @@ var defaultService = null;
|
|
|
157
189
|
|
|
158
190
|
|
|
159
191
|
/**
|
|
160
|
-
* Sets the default service to use for new
|
|
192
|
+
* Sets the default service to use for new Edge instances.
|
|
161
193
|
* @param {!remote.DriverService} service The service to use.
|
|
162
194
|
* @throws {Error} If the default service is currently running.
|
|
163
195
|
*/
|
|
@@ -172,10 +204,10 @@ function setDefaultService(service) {
|
|
|
172
204
|
|
|
173
205
|
|
|
174
206
|
/**
|
|
175
|
-
|
|
207
|
+
* Returns the default Microsoft Edge driver service. If such a service has
|
|
176
208
|
* not been configured, one will be constructed using the default configuration
|
|
177
|
-
* for
|
|
178
|
-
* @return {!remote.DriverService} The default
|
|
209
|
+
* for a MicrosoftWebDriver executable found on the system PATH.
|
|
210
|
+
* @return {!remote.DriverService} The default Microsoft Edge driver service.
|
|
179
211
|
*/
|
|
180
212
|
function getDefaultService() {
|
|
181
213
|
if (!defaultService) {
|
|
@@ -184,6 +216,13 @@ function getDefaultService() {
|
|
|
184
216
|
return defaultService;
|
|
185
217
|
}
|
|
186
218
|
|
|
219
|
+
function createServiceFromCapabilities(options) {
|
|
220
|
+
let exe;
|
|
221
|
+
if (useEdgeChromium(options)) {
|
|
222
|
+
exe = locateSynchronously(EDGE_CHROMIUM_BROWSER_NAME);
|
|
223
|
+
}
|
|
224
|
+
return new ServiceBuilder(exe).build();
|
|
225
|
+
}
|
|
187
226
|
|
|
188
227
|
/**
|
|
189
228
|
* Creates a new WebDriver client for Microsoft's Edge.
|
|
@@ -193,16 +232,16 @@ class Driver extends webdriver.WebDriver {
|
|
|
193
232
|
* Creates a new browser session for Microsoft's Edge browser.
|
|
194
233
|
*
|
|
195
234
|
* @param {(Capabilities|Options)=} options The configuration options.
|
|
196
|
-
* @param {remote.DriverService=} service The
|
|
197
|
-
*
|
|
235
|
+
* @param {remote.DriverService=} service The service to use; will create
|
|
236
|
+
* a new Legacy or Chromium service based on {@linkplain Options} by default.
|
|
198
237
|
* @return {!Driver} A new driver instance.
|
|
199
238
|
*/
|
|
200
239
|
static createSession(options, opt_service) {
|
|
201
|
-
|
|
240
|
+
options = options || new Options();
|
|
241
|
+
let service = opt_service || createServiceFromCapabilities(options);
|
|
202
242
|
let client = service.start().then(url => new http.HttpClient(url));
|
|
203
243
|
let executor = new http.Executor(client);
|
|
204
244
|
|
|
205
|
-
options = options || new Options();
|
|
206
245
|
return /** @type {!Driver} */(super.createSession(
|
|
207
246
|
executor, options, () => service.kill()));
|
|
208
247
|
}
|
package/firefox.js
CHANGED
|
@@ -156,8 +156,9 @@ class AddonFormatError extends Error {
|
|
|
156
156
|
* installed.
|
|
157
157
|
*/
|
|
158
158
|
async function installExtension(extension, dir) {
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
const ext = extension.slice(-4);
|
|
160
|
+
if (ext !== '.xpi' && ext !== '.zip') {
|
|
161
|
+
throw Error('File name does not end in ".zip" or ".xpi": ' + ext);
|
|
161
162
|
}
|
|
162
163
|
|
|
163
164
|
let archive = await zip.load(extension);
|
|
@@ -166,9 +167,26 @@ async function installExtension(extension, dir) {
|
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
let buf = await archive.getFile('manifest.json');
|
|
169
|
-
let
|
|
170
|
-
|
|
171
|
-
|
|
170
|
+
let parsedJSON = JSON.parse(buf.toString('utf8'));
|
|
171
|
+
|
|
172
|
+
let { browser_specific_settings } =
|
|
173
|
+
/** @type {{browser_specific_settings:{gecko:{id:string}}}} */
|
|
174
|
+
parsedJSON;
|
|
175
|
+
|
|
176
|
+
if (
|
|
177
|
+
browser_specific_settings &&
|
|
178
|
+
browser_specific_settings.gecko
|
|
179
|
+
) {
|
|
180
|
+
/* browser_specific_settings is an alternative to applications
|
|
181
|
+
* It is meant to facilitate cross-browser plugins since Firefox48
|
|
182
|
+
* see https://bugzilla.mozilla.org/show_bug.cgi?id=1262005
|
|
183
|
+
*/
|
|
184
|
+
parsedJSON.applications = browser_specific_settings;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
let { applications } =
|
|
188
|
+
/** @type {{applications:{gecko:{id:string}}}} */
|
|
189
|
+
parsedJSON;
|
|
172
190
|
if (!(applications && applications.gecko && applications.gecko.id)) {
|
|
173
191
|
throw new AddonFormatError(`Could not find add-on ID for ${extension}`);
|
|
174
192
|
}
|
package/http/index.js
CHANGED
|
@@ -187,6 +187,10 @@ function sendRequest(options, onOk, onError, opt_data, opt_proxy, opt_retries) {
|
|
|
187
187
|
options.hostname = proxy.hostname;
|
|
188
188
|
options.port = proxy.port;
|
|
189
189
|
|
|
190
|
+
// Update the protocol to avoid EPROTO errors when the webdriver proxy
|
|
191
|
+
// uses a different protocol from the remote selenium server.
|
|
192
|
+
options.protocol = opt_proxy.protocol;
|
|
193
|
+
|
|
190
194
|
if (proxy.auth) {
|
|
191
195
|
options.headers['Proxy-Authorization'] =
|
|
192
196
|
'Basic ' + new Buffer(proxy.auth).toString('base64');
|
package/io/index.js
CHANGED
package/lib/actions.js
CHANGED
|
@@ -255,7 +255,7 @@ class LegacyActionSequence {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
/**
|
|
258
|
-
* Convenience function for performing a "drag and drop"
|
|
258
|
+
* Convenience function for performing a "drag and drop" maneuver. The target
|
|
259
259
|
* element may be moved to the location of another element, or by an offset (in
|
|
260
260
|
* pixels).
|
|
261
261
|
*
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
module.exports = function(){return (function(){var g=this;function l(a){return"string"==typeof a}function aa(a,b){a=a.split(".");var c=g;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)a.length||void 0===b?c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}:c[d]=b}
|
|
3
3
|
function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
|
|
4
4
|
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function da(a,b,c){return a.call.apply(a.bind,arguments)}function ea(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}
|
|
5
|
-
function fa(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa=da:fa=ea;return fa.apply(null,arguments)}function ha(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}
|
|
6
|
-
function m(a,b){function c(){}c.prototype=b.prototype;a.M=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.L=function(d,e,f){for(var h=Array(arguments.length-2),k=2;k<arguments.length;k++)h[k-2]=arguments[k];return b.prototype[e].apply(d,h)}};/*
|
|
5
|
+
function fa(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?fa=da:fa=ea;return fa.apply(null,arguments)}function ha(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function m(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};/*
|
|
7
6
|
|
|
8
7
|
The MIT License
|
|
9
8
|
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
module.exports = function(){return (function(){var k=this;function l(a){return void 0!==a}function n(a){return"string"==typeof a}function aa(a,b){a=a.split(".");var c=k;a[0]in c||"undefined"==typeof c.execScript||c.execScript("var "+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&l(b)?c[d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}}
|
|
3
3
|
function ba(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return"array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return"function"}else return"null";
|
|
4
4
|
else if("function"==b&&"undefined"==typeof a.call)return"object";return b}function ca(a,b,c){return a.call.apply(a.bind,arguments)}function da(a,b,c){if(!a)throw Error();if(2<arguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}
|
|
5
|
-
function ea(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea=ca:ea=da;return ea.apply(null,arguments)}function fa(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}
|
|
6
|
-
function t(a,b){function c(){}c.prototype=b.prototype;a.K=b.prototype;a.prototype=new c;a.prototype.constructor=a;a.J=function(d,e,f){for(var g=Array(arguments.length-2),h=2;h<arguments.length;h++)g[h-2]=arguments[h];return b.prototype[e].apply(d,g)}};/*
|
|
5
|
+
function ea(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf("native code")?ea=ca:ea=da;return ea.apply(null,arguments)}function fa(a,b){var c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};/*
|
|
7
6
|
|
|
8
7
|
The MIT License
|
|
9
8
|
|
|
@@ -83,7 +82,7 @@ ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#0
|
|
|
83
82
|
lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",
|
|
84
83
|
moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",
|
|
85
84
|
seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};var oc="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),pc=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,qc=/^#(?:[0-9a-f]{3}){1,2}$/i,rc=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,sc=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function tc(a,b){this.code=a;this.a=V[a]||uc;this.message=b||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(c){return c.toUpperCase().replace(/^[\s\xa0]+/g,"")});b=a.length-5;if(0>b||a.indexOf("Error",b)!=b)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}t(tc,Error);var uc="unknown error",V={15:"element not selectable",11:"element not visible"};V[31]=uc;V[30]=uc;V[24]="invalid cookie domain";V[29]="invalid element coordinates";V[12]="invalid element state";
|
|
86
|
-
V[32]="invalid selector";V[51]="invalid selector";V[52]="invalid selector";V[17]="javascript error";V[405]="unsupported operation";V[34]="move target out of bounds";V[27]="no such alert";V[7]="no such element";V[8]="no such frame";V[23]="no such window";V[28]="script timeout";V[33]="session not created";V[10]="stale element reference";V[21]="timeout";V[25]="unable to set cookie";V[26]="unexpected alert open";V[13]=uc;V[9]="unknown command";var vc=ua(),wc=xa()||x("iPod"),xc=x("iPad"),yc=x("Android")&&!(va()||ua()||x("Opera")||x("Silk")),zc=va(),Ac=x("Safari")&&!(va()||x("Coast")||x("Opera")||x("Edge")||ua()||x("Silk")||x("Android"))&&!(xa()||x("iPad")||x("iPod"));function Bc(a){return(a=a.exec(v))?a[1]:""}(function(){if(vc)return Bc(/Firefox\/([0-9.]+)/);if(y||Ba||Aa)return Fa;if(zc)return xa()||x("iPad")||x("iPod")?Bc(/CriOS\/([0-9.]+)/):Bc(/Chrome\/([0-9.]+)/);if(Ac&&!(xa()||x("iPad")||x("iPod")))return Bc(/Version\/([0-9.]+)/);if(wc||xc){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(v);if(a)return a[1]+"."+a[2]}else if(yc)return(a=Bc(/Android\s+([0-9.]+)/))?a:Bc(/Version\/([0-9.]+)/);return""})();var Cc,Dc=function(){if(!Ca)return!1;var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(e){return!1}var b=a.classes;a=a.interfaces;var c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),d=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo).version;Cc=function(e){c.compare(d,""+e)};return!0}(),Ec=y&&!(9<=Number(Ka));yc&&Dc&&Cc(2.3);yc&&Dc&&Cc(4);Ac&&Dc&&Cc(6);function W(a,b){b&&"string"!==typeof b&&(b=b.toString());return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};var Fc=function(){var a={
|
|
85
|
+
V[32]="invalid selector";V[51]="invalid selector";V[52]="invalid selector";V[17]="javascript error";V[405]="unsupported operation";V[34]="move target out of bounds";V[27]="no such alert";V[7]="no such element";V[8]="no such frame";V[23]="no such window";V[28]="script timeout";V[33]="session not created";V[10]="stale element reference";V[21]="timeout";V[25]="unable to set cookie";V[26]="unexpected alert open";V[13]=uc;V[9]="unknown command";var vc=ua(),wc=xa()||x("iPod"),xc=x("iPad"),yc=x("Android")&&!(va()||ua()||x("Opera")||x("Silk")),zc=va(),Ac=x("Safari")&&!(va()||x("Coast")||x("Opera")||x("Edge")||ua()||x("Silk")||x("Android"))&&!(xa()||x("iPad")||x("iPod"));function Bc(a){return(a=a.exec(v))?a[1]:""}(function(){if(vc)return Bc(/Firefox\/([0-9.]+)/);if(y||Ba||Aa)return Fa;if(zc)return xa()||x("iPad")||x("iPod")?Bc(/CriOS\/([0-9.]+)/):Bc(/Chrome\/([0-9.]+)/);if(Ac&&!(xa()||x("iPad")||x("iPod")))return Bc(/Version\/([0-9.]+)/);if(wc||xc){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(v);if(a)return a[1]+"."+a[2]}else if(yc)return(a=Bc(/Android\s+([0-9.]+)/))?a:Bc(/Version\/([0-9.]+)/);return""})();var Cc,Dc=function(){if(!Ca)return!1;var a=k.Components;if(!a)return!1;try{if(!a.classes)return!1}catch(e){return!1}var b=a.classes;a=a.interfaces;var c=b["@mozilla.org/xpcom/version-comparator;1"].getService(a.nsIVersionComparator),d=b["@mozilla.org/xre/app-info;1"].getService(a.nsIXULAppInfo).version;Cc=function(e){c.compare(d,""+e)};return!0}(),Ec=y&&!(9<=Number(Ka));yc&&Dc&&Cc(2.3);yc&&Dc&&Cc(4);Ac&&Dc&&Cc(6);function W(a,b){b&&"string"!==typeof b&&(b=b.toString());return!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};var Fc=function(){var a={J:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
|
|
87
86
|
function Gc(a,b){var c=C(a);if(!c.documentElement)return null;(y||yc)&&mc(c?c.parentWindow||c.defaultView:window);try{var d=c.createNSResolver?c.createNSResolver(c.documentElement):Fc;if(y&&!Ja(7))return c.evaluate.call(c,b,a,d,9,null);if(!y||9<=Number(Ka)){for(var e={},f=c.getElementsByTagName("*"),g=0;g<f.length;++g){var h=f[g],m=h.namespaceURI;if(m&&!e[m]){var w=h.lookupPrefix(m);if(!w){var r=m.match(".*/(\\w+)/?$");w=r?r[1]:"xhtml"}e[m]=w}}var D={},M;for(M in e)D[e[M]]=M;d=function(N){return D[N]||
|
|
88
87
|
null}}try{return c.evaluate(b,a,d,9,null)}catch(N){if("TypeError"===N.name)return d=c.createNSResolver?c.createNSResolver(c.documentElement):Fc,c.evaluate(b,a,d,9,null);throw N;}}catch(N){if(!Ca||"NS_ERROR_ILLEGAL_VALUE"!=N.name)throw new tc(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+N);}}
|
|
89
88
|
function Hc(a,b){var c=function(){var d=Gc(b,a);return d?d.singleNodeValue||null:b.selectSingleNode?(d=C(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();if(null!==c&&(!c||1!=c.nodeType))throw new tc(32,'The result of the xpath expression "'+a+'" is: '+c+". It should be an element.");return c};function Ic(a,b,c,d){this.c=a;this.a=b;this.b=c;this.f=d}Ic.prototype.ceil=function(){this.c=Math.ceil(this.c);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.f=Math.ceil(this.f);return this};Ic.prototype.floor=function(){this.c=Math.floor(this.c);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.f=Math.floor(this.f);return this};Ic.prototype.round=function(){this.c=Math.round(this.c);this.a=Math.round(this.a);this.b=Math.round(this.b);this.f=Math.round(this.f);return this};function X(a,b,c,d){this.a=a;this.b=b;this.width=c;this.height=d}X.prototype.ceil=function(){this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};X.prototype.floor=function(){this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};
|
|
@@ -91,12 +90,12 @@ X.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b)
|
|
|
91
90
|
function Y(a,b){b=wa(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=Ec?"styleFloat":"cssFloat";a:{var c=b;var d=C(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||Lc(a,b);if(null===a)a=null;else if(0<=ia(oc,b)){b:{var e=a.match(rc);if(e&&(b=Number(e[1]),c=Number(e[2]),d=Number(e[3]),e=Number(e[4]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d&&0<=e&&1>=e)){b=[b,c,d,e];break b}b=null}if(!b)b:{if(d=a.match(sc))if(b=
|
|
92
91
|
Number(d[1]),c=Number(d[2]),d=Number(d[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=d&&255>=d){b=[b,c,d,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=nc[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(pc,"#$1$1$2$2$3$3")),!qc.test(c))){b=null;break b}b=[parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16),1]}a=b?"rgba("+b.join(", ")+")":a}return a}
|
|
93
92
|
function Lc(a,b){var c=a.currentStyle||a.style,d=c[b];!l(d)&&"function"==ba(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?l(d)?d:null:(a=Kc(a))?Lc(a,b):null}
|
|
94
|
-
function Mc(a,b,c){function d(g){var h=Nc(g);return 0<h.height&&0<h.width?!0:W(g,"PATH")&&(0<h.height||0<h.width)?(g=Y(g,"stroke-width"),!!g&&0<parseInt(g,10)):"hidden"!=Y(g,"overflow")&&la(g.childNodes,function(m){return 3==m.nodeType||W(m)&&d(m)})}function e(g){return Oc(g)==Z&&ma(g.childNodes,function(h){return!W(h)||e(h)||!d(h)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;
|
|
95
|
-
|
|
93
|
+
function Mc(a,b,c){function d(g){var h=Nc(g);return 0<h.height&&0<h.width?!0:W(g,"PATH")&&(0<h.height||0<h.width)?(g=Y(g,"stroke-width"),!!g&&0<parseInt(g,10)):"hidden"!=Y(g,"overflow")&&la(g.childNodes,function(m){return 3==m.nodeType||W(m)&&d(m)})}function e(g){return Oc(g)==Z&&ma(g.childNodes,function(h){return!W(h)||e(h)||!d(h)})}if(!W(a))throw Error("Argument to isShown must be of type Element");if(W(a,"BODY"))return!0;if(W(a,"OPTION")||W(a,"OPTGROUP"))return a=$a(a,function(g){return W(g,"SELECT")}),
|
|
94
|
+
!!a&&Mc(a,!0,c);var f=Pc(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&Mc(f.image,b,c);if(W(a,"INPUT")&&"hidden"==a.type.toLowerCase()||W(a,"NOSCRIPT"))return!1;f=Y(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Qc(a))&&d(a)?!e(a):!1}var Z="hidden";
|
|
96
95
|
function Oc(a){function b(p){function q(kb){if(kb==g)return!0;var ac=Y(kb,"display");return 0==ac.lastIndexOf("inline",0)||"contents"==ac||"absolute"==bc&&"static"==Y(kb,"position")?!1:!0}var bc=Y(p,"position");if("fixed"==bc)return w=!0,p==g?null:g;for(p=Kc(p);p&&!q(p);)p=Kc(p);return p}function c(p){var q=p;if("visible"==m)if(p==g&&h)q=h;else if(p==h)return{x:"visible",y:"visible"};q={x:Y(q,"overflow-x"),y:Y(q,"overflow-y")};p==g&&(q.x="visible"==q.x?"auto":q.x,q.y="visible"==q.y?"auto":q.y);return q}
|
|
97
96
|
function d(p){if(p==g){var q=(new ab(f)).a;p=q.scrollingElement?q.scrollingElement:Da||"CSS1Compat"!=q.compatMode?q.body||q.documentElement:q.documentElement;q=q.parentWindow||q.defaultView;p=y&&Ja("10")&&q.pageYOffset!=p.scrollTop?new Ua(p.scrollLeft,p.scrollTop):new Ua(q.pageXOffset||p.scrollLeft,q.pageYOffset||p.scrollTop)}else p=new Ua(p.scrollLeft,p.scrollTop);return p}var e=Rc(a),f=C(a),g=f.documentElement,h=f.body,m=Y(g,"overflow"),w;for(a=b(a);a;a=b(a)){var r=c(a);if("visible"!=r.x||"visible"!=
|
|
98
97
|
r.y){var D=Nc(a);if(0==D.width||0==D.height)return Z;var M=e.a<D.a,N=e.b<D.b;if(M&&"hidden"==r.x||N&&"hidden"==r.y)return Z;if(M&&"visible"!=r.x||N&&"visible"!=r.y){M=d(a);N=e.b<D.b-M.y;if(e.a<D.a-M.x&&"visible"!=r.x||N&&"visible"!=r.x)return Z;e=Oc(a);return e==Z?Z:"scroll"}M=e.f>=D.a+D.width;D=e.c>=D.b+D.height;if(M&&"hidden"==r.x||D&&"hidden"==r.y)return Z;if(M&&"visible"!=r.x||D&&"visible"!=r.y){if(w&&(r=d(a),e.f>=g.scrollWidth-r.x||e.a>=g.scrollHeight-r.y))return Z;e=Oc(a);return e==Z?Z:"scroll"}}}return"none"}
|
|
99
98
|
function Nc(a){var b=Pc(a);if(b)return b.rect;if(W(a,"HTML"))return a=C(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new Va(a.clientWidth,a.clientHeight),new X(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new X(0,0,0,0)}b=new X(c.left,c.top,c.right-c.left,c.bottom-c.top);y&&a.ownerDocument.body&&(a=C(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop);
|
|
100
99
|
return b}function Pc(a){var b=W(a,"MAP");if(!b&&!W(a,"AREA"))return null;var c=b?a:W(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=Hc('/descendant::*[@usemap = "#'+c.name+'"]',C(c)))&&(e=Nc(d),b||"default"==a.shape.toLowerCase()||(a=Sc(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new X(b+e.a,c+e.b,Math.min(a.width,e.width-b),Math.min(a.height,e.height-c))));return{image:d,rect:e||new X(0,0,0,0)}}
|
|
101
100
|
function Sc(a){var b=a.shape.toLowerCase();a=a.coords.split(",");if("rect"==b&&4==a.length){b=a[0];var c=a[1];return new X(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new X(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){b=a[0];c=a[1];for(var d=b,e=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),d=Math.max(d,a[f]),c=Math.min(c,a[f+1]),e=Math.max(e,a[f+1]);return new X(b,c,d-b,e-c)}return new X(0,0,0,0)}function Rc(a){a=Nc(a);return new Ic(a.b,a.a+a.width,a.b+a.height,a.a)}
|
|
102
|
-
function Qc(a){if(Ec){if("relative"==Y(a,"position"))return 1;a=Y(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Tc(a)}function Tc(a){var b=1,c=Y(a,"opacity");c&&(b=Number(c));(a=Kc(a))&&(b*=Tc(a));return b};aa("_",function(a,b){function c(d){if(W(d)&&"none"==Y(d,"display"))return!1;var e;(e=d.parentNode)&&e.shadowRoot&&void 0!==d.assignedSlot
|
|
101
|
+
function Qc(a){if(Ec){if("relative"==Y(a,"position"))return 1;a=Y(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Tc(a)}function Tc(a){var b=1,c=Y(a,"opacity");c&&(b=Number(c));(a=Kc(a))&&(b*=Tc(a));return b};aa("_",function(a,b){function c(d){if(W(d)&&"none"==Y(d,"display"))return!1;var e;if((e=d.parentNode)&&e.shadowRoot&&void 0!==d.assignedSlot)e=d.assignedSlot?d.assignedSlot.parentNode:null;else if(d.getDestinationInsertionPoints){var f=d.getDestinationInsertionPoints();0<f.length&&(e=f[f.length-1])}if(Jc&&e instanceof ShadowRoot){if(e.host.shadowRoot!==e)return!1;e=e.host}return!e||9!=e.nodeType&&11!=e.nodeType?e&&W(e,"DETAILS")&&!e.open&&!W(d,"SUMMARY")?!1:e&&c(e):!0}return Mc(a,!!b,c)});; return this._.apply(null,arguments);}).apply({navigator:typeof window!='undefined'?window.navigator:null,document:typeof window!='undefined'?window.document:null}, arguments);};
|
|
@@ -1,3 +1,20 @@
|
|
|
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
|
+
|
|
1
18
|
const fs = require('fs');
|
|
2
19
|
const path = require('path');
|
|
3
20
|
|
package/lib/capabilities.js
CHANGED
|
@@ -91,7 +91,7 @@ const Platform = {
|
|
|
91
91
|
function Timeouts() {}
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* Defines when, in milliseconds, to
|
|
94
|
+
* Defines when, in milliseconds, to interrupt a script that is being
|
|
95
95
|
* {@linkplain ./webdriver.IWebDriver#executeScript evaluated}.
|
|
96
96
|
* @type {number}
|
|
97
97
|
*/
|
|
@@ -105,7 +105,7 @@ Timeouts.prototype.script;
|
|
|
105
105
|
Timeouts.prototype.pageLoad;
|
|
106
106
|
|
|
107
107
|
/**
|
|
108
|
-
* The
|
|
108
|
+
* The maximum amount of time, in milliseconds, to spend attempting to
|
|
109
109
|
* {@linkplain ./webdriver.IWebDriver#findElement locate} an element on the
|
|
110
110
|
* current page.
|
|
111
111
|
* @type {number}
|
|
@@ -149,7 +149,7 @@ const UserPromptHandler = {
|
|
|
149
149
|
const Capability = {
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
|
-
* Indicates whether a WebDriver session
|
|
152
|
+
* Indicates whether a WebDriver session implicitly trusts otherwise untrusted
|
|
153
153
|
* and self-signed TLS certificates during navigation.
|
|
154
154
|
*/
|
|
155
155
|
ACCEPT_INSECURE_TLS_CERTS: 'acceptInsecureCerts',
|
|
@@ -168,7 +168,7 @@ const Capability = {
|
|
|
168
168
|
* The browser name. Common browser names are defined in the
|
|
169
169
|
* {@link ./capabilities.Browser Browser} enum.
|
|
170
170
|
*/
|
|
171
|
-
LOGGING_PREFS: 'loggingPrefs',
|
|
171
|
+
LOGGING_PREFS: 'goog:loggingPrefs',
|
|
172
172
|
|
|
173
173
|
/**
|
|
174
174
|
* Defines the session's
|
|
@@ -212,6 +212,12 @@ const Capability = {
|
|
|
212
212
|
* prompts.
|
|
213
213
|
*/
|
|
214
214
|
UNHANDLED_PROMPT_BEHAVIOR: 'unhandledPromptBehavior',
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* Defines the current session’s strict file interactability.
|
|
218
|
+
* Used to upload a file when strict file interactability is on
|
|
219
|
+
*/
|
|
220
|
+
STRICT_FILE_INTERACTABILITY: 'strictFileInteractability',
|
|
215
221
|
};
|
|
216
222
|
|
|
217
223
|
|
|
@@ -512,6 +518,13 @@ class Capabilities {
|
|
|
512
518
|
getAlertBehavior() {
|
|
513
519
|
return this.get(Capability.UNHANDLED_PROMPT_BEHAVIOR);
|
|
514
520
|
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Sets the boolean flag configuration for this instance.
|
|
524
|
+
*/
|
|
525
|
+
setStrictFileInteractability(strictFileInteractability) {
|
|
526
|
+
return this.set(Capability.STRICT_FILE_INTERACTABILITY, strictFileInteractability);
|
|
527
|
+
}
|
|
515
528
|
}
|
|
516
529
|
|
|
517
530
|
|
package/lib/command.js
CHANGED
|
@@ -150,6 +150,7 @@ const Name = {
|
|
|
150
150
|
GET_ELEMENT_SIZE: 'getElementSize',
|
|
151
151
|
GET_ELEMENT_ATTRIBUTE: 'getElementAttribute',
|
|
152
152
|
GET_ELEMENT_VALUE_OF_CSS_PROPERTY: 'getElementValueOfCssProperty',
|
|
153
|
+
GET_ELEMENT_PROPERTY: 'getElementProperty',
|
|
153
154
|
|
|
154
155
|
SCREENSHOT: 'screenshot',
|
|
155
156
|
TAKE_ELEMENT_SCREENSHOT: 'takeElementScreenshot',
|
package/lib/http.js
CHANGED
|
@@ -33,10 +33,10 @@ const {Session} = require('./session');
|
|
|
33
33
|
const {WebElement} = require('./webdriver');
|
|
34
34
|
|
|
35
35
|
const getAttribute = requireAtom(
|
|
36
|
-
'
|
|
36
|
+
'get-attribute.js',
|
|
37
37
|
'//javascript/node/selenium-webdriver/lib/atoms:get-attribute.js');
|
|
38
38
|
const isDisplayed = requireAtom(
|
|
39
|
-
'
|
|
39
|
+
'is-displayed.js',
|
|
40
40
|
'//javascript/node/selenium-webdriver/lib/atoms:is-displayed.js');
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -46,7 +46,7 @@ const isDisplayed = requireAtom(
|
|
|
46
46
|
*/
|
|
47
47
|
function requireAtom(module, bazelTarget) {
|
|
48
48
|
try {
|
|
49
|
-
return require(module);
|
|
49
|
+
return require('./atoms/' + module);
|
|
50
50
|
} catch (ex) {
|
|
51
51
|
try {
|
|
52
52
|
const file = bazelTarget.slice(2).replace(':', '/');
|
|
@@ -221,6 +221,7 @@ const COMMAND_MAP = new Map([
|
|
|
221
221
|
[cmd.Name.GET_ELEMENT_LOCATION, get('/session/:sessionId/element/:id/location')],
|
|
222
222
|
[cmd.Name.GET_ELEMENT_SIZE, get('/session/:sessionId/element/:id/size')],
|
|
223
223
|
[cmd.Name.GET_ELEMENT_ATTRIBUTE, get('/session/:sessionId/element/:id/attribute/:name')],
|
|
224
|
+
[cmd.Name.GET_ELEMENT_PROPERTY, get('/session/:sessionId/element/:id/property/:name')],
|
|
224
225
|
[cmd.Name.GET_ELEMENT_VALUE_OF_CSS_PROPERTY, get('/session/:sessionId/element/:id/css/:propertyName')],
|
|
225
226
|
[cmd.Name.TAKE_ELEMENT_SCREENSHOT, get('/session/:sessionId/element/:id/screenshot')],
|
|
226
227
|
[cmd.Name.SWITCH_TO_WINDOW, post('/session/:sessionId/window')],
|
|
@@ -309,6 +310,7 @@ const W3C_COMMAND_MAP = new Map([
|
|
|
309
310
|
[cmd.Name.FIND_CHILD_ELEMENTS, post('/session/:sessionId/element/:id/elements')],
|
|
310
311
|
// Element interaction.
|
|
311
312
|
[cmd.Name.GET_ELEMENT_TAG_NAME, get('/session/:sessionId/element/:id/name')],
|
|
313
|
+
[cmd.Name.GET_ELEMENT_PROPERTY, get('/session/:sessionId/element/:id/property/:name')],
|
|
312
314
|
[cmd.Name.GET_ELEMENT_VALUE_OF_CSS_PROPERTY, get('/session/:sessionId/element/:id/css/:propertyName')],
|
|
313
315
|
[cmd.Name.GET_ELEMENT_RECT, get('/session/:sessionId/element/:id/rect')],
|
|
314
316
|
[cmd.Name.CLEAR_ELEMENT, post('/session/:sessionId/element/:id/clear')],
|
|
@@ -336,6 +338,9 @@ const W3C_COMMAND_MAP = new Map([
|
|
|
336
338
|
// Screenshots.
|
|
337
339
|
[cmd.Name.SCREENSHOT, get('/session/:sessionId/screenshot')],
|
|
338
340
|
[cmd.Name.TAKE_ELEMENT_SCREENSHOT, get('/session/:sessionId/element/:id/screenshot')],
|
|
341
|
+
// Log extensions.
|
|
342
|
+
[cmd.Name.GET_LOG, post('/session/:sessionId/se/log')],
|
|
343
|
+
[cmd.Name.GET_AVAILABLE_LOG_TYPES, get('/session/:sessionId/se/log/types')],
|
|
339
344
|
]);
|
|
340
345
|
|
|
341
346
|
|
package/lib/input.js
CHANGED
|
@@ -152,7 +152,7 @@ Key.chord = function(...keys) {
|
|
|
152
152
|
* elements. Of particular note is the
|
|
153
153
|
* {@link selenium-webdriver/remote.FileDetector}, which should be used when
|
|
154
154
|
* running against a remote
|
|
155
|
-
* [Selenium Server](
|
|
155
|
+
* [Selenium Server](https://selenium.dev/downloads/).
|
|
156
156
|
*/
|
|
157
157
|
class FileDetector {
|
|
158
158
|
|
|
@@ -478,7 +478,7 @@ Pointer.Type = {
|
|
|
478
478
|
*
|
|
479
479
|
* The length of each action tick is however long it takes the remote end to
|
|
480
480
|
* execute the actions for every device in that tick. Most actions are
|
|
481
|
-
* "
|
|
481
|
+
* "instantaneous", however, {@linkplain #pause pause} and
|
|
482
482
|
* {@linkplain #move pointer move} actions allow you to specify a duration for
|
|
483
483
|
* how long that action should take. The remote end will always wait for all
|
|
484
484
|
* actions within a tick to finish before starting the next tick, so a device
|
|
@@ -495,7 +495,7 @@ Pointer.Type = {
|
|
|
495
495
|
*
|
|
496
496
|
* This implicit waiting also applies to pauses. In the table below, even though
|
|
497
497
|
* the keyboard only defines a pause of 100 ms, the remote end will wait an
|
|
498
|
-
* additional 200 ms for the mouse
|
|
498
|
+
* additional 200 ms for the mouse move to finish before moving to Tick 2.
|
|
499
499
|
*
|
|
500
500
|
* | Device | Tick 1 | Tick 2 |
|
|
501
501
|
* | -------- | --------------------- | -------------- |
|
|
@@ -554,13 +554,13 @@ Pointer.Type = {
|
|
|
554
554
|
* when translating actions to the legacy protocol.
|
|
555
555
|
*
|
|
556
556
|
* 6. For W3C actions, move offsets relative to a
|
|
557
|
-
* {@linkplain ./webdriver.WebElement WebElement} are
|
|
557
|
+
* {@linkplain ./webdriver.WebElement WebElement} are interpreted relative
|
|
558
558
|
* to the center of an element's _first_ [client rect] in the viewport. For
|
|
559
559
|
* legacy actions, element offsets are relative to the top-left corner of
|
|
560
560
|
* the element's [bounding client rect]. When translating actions to the
|
|
561
561
|
* legacy protocol in bridge mode, an extra command must be inserted to
|
|
562
562
|
* translate move offsets from one frame of reference to the other. This
|
|
563
|
-
* extra command
|
|
563
|
+
* extra command contributes to the overall latency issue outlined in
|
|
564
564
|
* point 1.
|
|
565
565
|
*
|
|
566
566
|
* [client rect]: https://developer.mozilla.org/en-US/docs/Web/API/Element/getClientRects
|
|
@@ -692,7 +692,7 @@ class Actions {
|
|
|
692
692
|
* If no devices are specified, a pause action will be created (using the same
|
|
693
693
|
* duration) for every device.
|
|
694
694
|
*
|
|
695
|
-
* When device
|
|
695
|
+
* When device synchronization is enabled (the default for new {@link Actions}
|
|
696
696
|
* objects), there is no need to specify devices as pausing one automatically
|
|
697
697
|
* pauses the others for the same duration. In other words, the following are
|
|
698
698
|
* all equivalent:
|
package/lib/logging.js
CHANGED
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
* **NOTE:** Only a few browsers support the remote logging API (notably
|
|
57
57
|
* Firefox and Chrome). Firefox supports basic logging functionality, while
|
|
58
58
|
* Chrome exposes robust
|
|
59
|
-
* [performance logging](https://
|
|
59
|
+
* [performance logging](https://chromedriver.chromium.org/logging)
|
|
60
60
|
* options. Remote logging is still considered a non-standard feature, and the
|
|
61
61
|
* APIs exposed by this module for it are non-frozen. This module will be
|
|
62
62
|
* updated, possibly breaking backwards-compatibility, once logging is
|