selenium-webdriver 4.26.0 → 4.28.0
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 +19 -0
- package/LICENSE +1 -1
- package/NOTICE +1 -1
- package/README.md +16 -16
- package/bidi/browsingContext.js +7 -3
- package/bidi/continueRequestParameters.js +1 -1
- package/bidi/filterBy.js +1 -1
- package/bidi/logEntries.js +3 -1
- package/bidi/protocolValue.js +2 -2
- package/bidi/storage.js +2 -10
- package/bin/linux/selenium-manager +0 -0
- package/bin/macos/selenium-manager +0 -0
- package/bin/windows/selenium-manager.exe +0 -0
- package/lib/atoms/find-elements.js +41 -39
- package/lib/by.js +54 -2
- package/lib/command.js +11 -0
- package/lib/fedcm/account.js +78 -0
- package/lib/fedcm/dialog.js +76 -0
- package/lib/http.js +10 -0
- package/lib/network.js +33 -20
- package/lib/webdriver.js +30 -7
- package/package.json +22 -12
- package/safari.js +13 -0
package/CHANGES.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
## 4.28.0
|
|
2
|
+
|
|
3
|
+
- Add CDP for Chrome 132 and remove 129
|
|
4
|
+
- [js] Add Federated Credential Management support (#15008)
|
|
5
|
+
- [JS] Specify Node.js engine version as 22.x LTS in package.json (#15058)
|
|
6
|
+
- [JS] Add detailed error message for invalid cookie name validation in getCookie method
|
|
7
|
+
- [JS] Add err message for invalid cookie name in deleteCookie method
|
|
8
|
+
- [JS] Enables diagnostic logging for Safari
|
|
9
|
+
- [java][JS][py] Add straight relative-by locators (#14482)
|
|
10
|
+
|
|
11
|
+
## 4.27.0
|
|
12
|
+
|
|
13
|
+
- Add CDP for Chrome 131 and remove 128
|
|
14
|
+
- Add Firefox CDP deprecation warnings
|
|
15
|
+
- Update supported versions for Chrome DevTools
|
|
16
|
+
- [bidi] Allow passing in uri for authentication handlers (#14386)
|
|
17
|
+
- [bidi] Enable locate node tests for Chrome and Edge
|
|
18
|
+
- [bidi] Ensure start nodes are serialized
|
|
19
|
+
|
|
1
20
|
## 4.26.0
|
|
2
21
|
|
|
3
22
|
- Add CDP for Chrome 130 and remove 127
|
package/LICENSE
CHANGED
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
same "printed page" as the copyright notice for easier
|
|
188
188
|
identification within third-party archives.
|
|
189
189
|
|
|
190
|
-
Copyright
|
|
190
|
+
Copyright 2025 Software Freedom Conservancy (SFC)
|
|
191
191
|
|
|
192
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
193
|
you may not use this file except in compliance with the License.
|
package/NOTICE
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
Copyright 2011-
|
|
1
|
+
Copyright 2011-2025 Software Freedom Conservancy
|
|
2
2
|
Copyright 2004-2011 Selenium committers
|
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ To use the Selenium Server, you will need to install the
|
|
|
91
91
|
download the latest server from [Selenium][release]. Once downloaded, run the
|
|
92
92
|
server with
|
|
93
93
|
|
|
94
|
-
java -jar selenium-server-4.
|
|
94
|
+
java -jar selenium-server-4.27.0.jar standalone
|
|
95
95
|
|
|
96
96
|
You may configure your tests to run against a remote server through the Builder
|
|
97
97
|
API:
|
|
@@ -135,18 +135,17 @@ will also have "best effort" support. Releases older than the latest LTS,
|
|
|
135
135
|
_semver-major_ releases, and all unstable release branches (e.g. "v.Next")
|
|
136
136
|
are considered strictly unsupported.
|
|
137
137
|
|
|
138
|
-
For example, suppose the current LTS and stable releases are
|
|
139
|
-
|
|
138
|
+
For example, suppose the current LTS and stable releases are v22.13.0 and
|
|
139
|
+
v23.6.0,
|
|
140
140
|
respectively. Then a Selenium release would have the following support levels:
|
|
141
141
|
|
|
142
|
-
| Version
|
|
143
|
-
|
|
|
144
|
-
| <=
|
|
145
|
-
|
|
|
146
|
-
|
|
|
147
|
-
|
|
|
148
|
-
|
|
|
149
|
-
| v.Next | _unsupported_ |
|
|
142
|
+
| Version | Support |
|
|
143
|
+
| :--------: | :-----------: |
|
|
144
|
+
| <= 16.20.2 | _unsupported_ |
|
|
145
|
+
| 16.20.2 | supported |
|
|
146
|
+
| 18.8.0 | supported |
|
|
147
|
+
| >= 22.13.0 | best effort |
|
|
148
|
+
| v.Next | _unsupported_ |
|
|
150
149
|
|
|
151
150
|
### Support Level Definitions
|
|
152
151
|
|
|
@@ -168,11 +167,12 @@ months, the support window for selenium-webdriver will be roughly:
|
|
|
168
167
|
|
|
169
168
|
| Release | Status | END-OF-LIFE |
|
|
170
169
|
| :-----: | :-------------: | :---------: |
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
174
|
-
|
|
|
175
|
-
|
|
|
170
|
+
| v18.x | Maintenance LTS | 2025-04-30 |
|
|
171
|
+
| v19.x | End-of-Life | 2023-06-01 |
|
|
172
|
+
| v20.x | Maintenance LTS | 2026-04-30 |
|
|
173
|
+
| v21.x | End-of-Life | 2024-06-01 |
|
|
174
|
+
| V22.x | Active LTS | 2027-04-30 |
|
|
175
|
+
| V23.x | Current | 2025-06-01 |
|
|
176
176
|
|
|
177
177
|
## Issues
|
|
178
178
|
|
package/bidi/browsingContext.js
CHANGED
|
@@ -156,8 +156,7 @@ class BrowsingContext {
|
|
|
156
156
|
method: 'browsingContext.create',
|
|
157
157
|
params: Object.fromEntries(parameters),
|
|
158
158
|
}
|
|
159
|
-
|
|
160
|
-
return res
|
|
159
|
+
return await this.bidi.send(params)
|
|
161
160
|
}
|
|
162
161
|
|
|
163
162
|
/**
|
|
@@ -528,10 +527,15 @@ class BrowsingContext {
|
|
|
528
527
|
throw Error(`Pass in an array of ReferenceValue objects. Received: ${startNodes}`)
|
|
529
528
|
}
|
|
530
529
|
|
|
530
|
+
let startNodesSerialized = undefined
|
|
531
|
+
|
|
531
532
|
if (startNodes !== undefined && Array.isArray(startNodes)) {
|
|
533
|
+
startNodesSerialized = []
|
|
532
534
|
startNodes.forEach((node) => {
|
|
533
535
|
if (!(node instanceof ReferenceValue)) {
|
|
534
536
|
throw Error(`Pass in a ReferenceValue object. Received: ${node}`)
|
|
537
|
+
} else {
|
|
538
|
+
startNodesSerialized.push(node.asMap())
|
|
535
539
|
}
|
|
536
540
|
})
|
|
537
541
|
}
|
|
@@ -544,7 +548,7 @@ class BrowsingContext {
|
|
|
544
548
|
maxNodeCount: maxNodeCount,
|
|
545
549
|
sandbox: sandbox,
|
|
546
550
|
serializationOptions: serializationOptions,
|
|
547
|
-
startNodes:
|
|
551
|
+
startNodes: startNodesSerialized,
|
|
548
552
|
},
|
|
549
553
|
}
|
|
550
554
|
|
|
@@ -47,7 +47,7 @@ class ContinueRequestParameters {
|
|
|
47
47
|
* Sets the cookies for the request.
|
|
48
48
|
*
|
|
49
49
|
* @param {Header[]} cookieHeaders - An array of cookie headers.
|
|
50
|
-
* @returns {
|
|
50
|
+
* @returns {ContinueRequestParameters} - The current instance of the ContinueRequestParameters for chaining.
|
|
51
51
|
* @throws {Error} - If a cookie header is not an instance of Header.
|
|
52
52
|
*/
|
|
53
53
|
cookies(cookieHeaders) {
|
package/bidi/filterBy.js
CHANGED
|
@@ -21,7 +21,7 @@ class FilterBy {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
static logLevel(level) {
|
|
24
|
-
if (level === undefined || (level
|
|
24
|
+
if (level === undefined || (level !== undefined && !['debug', 'error', 'info', 'warning'].includes(level))) {
|
|
25
25
|
throw Error(
|
|
26
26
|
`Please pass valid log level. Valid log levels are 'debug', 'error', 'info' and 'warning'. Received: ${level}`,
|
|
27
27
|
)
|
package/bidi/logEntries.js
CHANGED
|
@@ -21,12 +21,13 @@ const { Source } = require('./scriptTypes')
|
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
23
|
* Represents a base log entry.
|
|
24
|
-
*
|
|
24
|
+
* Described in https://w3c.github.io/webdriver-bidi/#types-log-logentry.
|
|
25
25
|
*/
|
|
26
26
|
class BaseLogEntry {
|
|
27
27
|
/**
|
|
28
28
|
* Creates a new instance of BaseLogEntry.
|
|
29
29
|
* @param {string} level - The log level.
|
|
30
|
+
* @param {source} source - Script Source
|
|
30
31
|
* @param {string} text - The log source.
|
|
31
32
|
* @param {string} text - The log text.
|
|
32
33
|
* @param {number} timeStamp - The log timestamp.
|
|
@@ -86,6 +87,7 @@ class GenericLogEntry extends BaseLogEntry {
|
|
|
86
87
|
/**
|
|
87
88
|
* Creates an instance of GenericLogEntry.
|
|
88
89
|
* @param {string} level - The log level.
|
|
90
|
+
* @param {source} source - Script Source
|
|
89
91
|
* @param {string} text - The log text.
|
|
90
92
|
* @param {Date} timeStamp - The log timestamp.
|
|
91
93
|
* @param {string} type - The log type.
|
package/bidi/protocolValue.js
CHANGED
|
@@ -145,7 +145,7 @@ class LocalValue {
|
|
|
145
145
|
/**
|
|
146
146
|
* Creates a new LocalValue object from the passed object.
|
|
147
147
|
*
|
|
148
|
-
* @param {Object}
|
|
148
|
+
* @param {Object} object - The object.
|
|
149
149
|
* @returns {LocalValue} - The created LocalValue object.
|
|
150
150
|
*/
|
|
151
151
|
static createObjectValue(object) {
|
|
@@ -431,7 +431,7 @@ class ChannelValue {
|
|
|
431
431
|
}
|
|
432
432
|
}
|
|
433
433
|
|
|
434
|
-
if (resultOwnership
|
|
434
|
+
if (resultOwnership !== undefined) {
|
|
435
435
|
if (['root', 'none'].includes(resultOwnership)) {
|
|
436
436
|
this.resultOwnership = resultOwnership
|
|
437
437
|
} else {
|
package/bidi/storage.js
CHANGED
|
@@ -138,11 +138,7 @@ class Storage {
|
|
|
138
138
|
Object.prototype.hasOwnProperty.call(response.result.partitionKey, 'userContext') &&
|
|
139
139
|
Object.prototype.hasOwnProperty.call(response.result.partitionKey, 'sourceOrigin')
|
|
140
140
|
) {
|
|
141
|
-
|
|
142
|
-
response.result.partitionKey.userContext,
|
|
143
|
-
response.result.partitionKey.sourceOrigin,
|
|
144
|
-
)
|
|
145
|
-
return partitionKey
|
|
141
|
+
return new PartitionKey(response.result.partitionKey.userContext, response.result.partitionKey.sourceOrigin)
|
|
146
142
|
}
|
|
147
143
|
}
|
|
148
144
|
}
|
|
@@ -182,11 +178,7 @@ class Storage {
|
|
|
182
178
|
Object.prototype.hasOwnProperty.call(response.result.partitionKey, 'userContext') &&
|
|
183
179
|
Object.prototype.hasOwnProperty.call(response.result.partitionKey, 'sourceOrigin')
|
|
184
180
|
) {
|
|
185
|
-
|
|
186
|
-
response.result.partitionKey.userContext,
|
|
187
|
-
response.result.partitionKey.sourceOrigin,
|
|
188
|
-
)
|
|
189
|
-
return partitionKey
|
|
181
|
+
return new PartitionKey(response.result.partitionKey.userContext, response.result.partitionKey.sourceOrigin)
|
|
190
182
|
}
|
|
191
183
|
}
|
|
192
184
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -32,8 +32,8 @@ function ma(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var na;var oa=Array.prototy
|
|
|
32
32
|
b,void 0)}:function(a,b){for(var c=a.length,d=[],e=0,f="string"===typeof a?a.split(""):a,g=0;g<c;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d},qa=Array.prototype.map?function(a,b){return Array.prototype.map.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=Array(c),e="string"===typeof a?a.split(""):a,f=0;f<c;f++)f in e&&(d[f]=b.call(void 0,e[f],f,a));return d},ra=Array.prototype.reduce?function(a,b,c){return Array.prototype.reduce.call(a,b,c)}:function(a,b,c){var d=c;l(a,
|
|
33
33
|
function(e,f){d=b.call(void 0,d,e,f,a)});return d},sa=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a))return!0;return!1},ta=Array.prototype.every?function(a,b,c){return Array.prototype.every.call(a,b,c)}:function(a,b,c){for(var d=a.length,e="string"===typeof a?a.split(""):a,f=0;f<d;f++)if(f in e&&!b.call(c,e[f],f,a))return!1;return!0};
|
|
34
34
|
function ua(a,b){a:{for(var c=a.length,d="string"===typeof a?a.split(""):a,e=0;e<c;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:"string"===typeof a?a.charAt(b):a[b]}function va(a){return Array.prototype.concat.apply([],arguments)}function wa(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)}function xa(a,b){a.sort(b||ya)}function ya(a,b){return a>b?1:a<b?-1:0};function za(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var Aa=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};
|
|
35
|
-
function Ba(a,b){var c=0;a=Aa(String(a)).split(".");b=Aa(String(b)).split(".");for(var d=Math.max(a.length,b.length),e=0;0==c&&e<d;e++){var f=a[e]||"",g=b[e]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];if(0==f[0].length&&0==g[0].length)break;c=Ca(0==f[1].length?0:parseInt(f[1],10),0==g[1].length?0:parseInt(g[1],10))||Ca(0==f[2].length,0==g[2].length)||Ca(f[2],g[2]);f=f[3];g=g[3]}while(0==c)}return c}function Ca(a,b){return a<b?-1:a>b?1:0};var
|
|
36
|
-
a:{var Ra="",Sa=function(){var a=
|
|
35
|
+
function Ba(a,b){var c=0;a=Aa(String(a)).split(".");b=Aa(String(b)).split(".");for(var d=Math.max(a.length,b.length),e=0;0==c&&e<d;e++){var f=a[e]||"",g=b[e]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];if(0==f[0].length&&0==g[0].length)break;c=Ca(0==f[1].length?0:parseInt(f[1],10),0==g[1].length?0:parseInt(g[1],10))||Ca(0==f[2].length,0==g[2].length)||Ca(f[2],g[2]);f=f[3];g=g[3]}while(0==c)}return c}function Ca(a,b){return a<b?-1:a>b?1:0};var m;a:{var Da=aa.navigator;if(Da){var Ea=Da.userAgent;if(Ea){m=Ea;break a}}m=""}function r(a){return-1!=m.indexOf(a)};function Fa(){return r("Firefox")||r("FxiOS")}function Ga(){return(r("Chrome")||r("CriOS"))&&!r("Edge")};function Ha(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function Ia(){return r("iPhone")&&!r("iPod")&&!r("iPad")};function Ja(a,b){var c=Ka;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var La=r("Opera"),t=r("Trident")||r("MSIE"),Ma=r("Edge"),Na=r("Gecko")&&!(-1!=m.toLowerCase().indexOf("webkit")&&!r("Edge"))&&!(r("Trident")||r("MSIE"))&&!r("Edge"),Oa=-1!=m.toLowerCase().indexOf("webkit")&&!r("Edge");function Pa(){var a=aa.document;return a?a.documentMode:void 0}var Qa;
|
|
36
|
+
a:{var Ra="",Sa=function(){var a=m;if(Na)return/rv:([^\);]+)(\)|;)/.exec(a);if(Ma)return/Edge\/([\d\.]+)/.exec(a);if(t)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(Oa)return/WebKit\/(\S+)/.exec(a);if(La)return/(?:Version)[ \/]?(\S+)/.exec(a)}();Sa&&(Ra=Sa?Sa[1]:"");if(t){var Ta=Pa();if(null!=Ta&&Ta>parseFloat(Ra)){Qa=String(Ta);break a}}Qa=Ra}var Ka={};function Ua(a){return Ja(a,function(){return 0<=Ba(Qa,a)})}var w;w=aa.document&&t?Pa():void 0;var x=t&&!(9<=Number(w)),Va=t&&!(8<=Number(w));function Wa(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElement=b}function Xa(a,b){var c=Va&&"href"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Wa(b,a,b.nodeName,c)};function Ya(a){this.b=a;this.a=0}function Za(a){a=a.match($a);for(var b=0;b<a.length;b++)ab.test(a[b])&&a.splice(b,1);return new Ya(a)}var $a=/\$?(?:(?![0-9-\.])(?:\*|[\w-\.]+):)?(?![0-9-\.])(?:\*|[\w-\.]+)|\/\/|\.\.|::|\d+(?:\.\d*)?|\.\d+|"[^"]*"|'[^']*'|[!<>]=|\s+|./g,ab=/^\s/;function y(a,b){return a.b[a.a+(b||0)]}function z(a){return a.b[a.a++]}function bb(a){return a.b.length<=a.a};function cb(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}cb.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};cb.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};cb.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function db(a,b){this.width=a;this.height=b}db.prototype.aspectRatio=function(){return this.width/this.height};db.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};db.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};db.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function eb(a){return a?new fb(A(a)):na||(na=new fb)}function gb(a){for(;a&&1!=a.nodeType;)a=a.previousSibling;return a}function hb(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if("undefined"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b)&16);for(;b&&a!=b;)b=b.parentNode;return b==a}
|
|
37
37
|
function ib(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(t&&!(9<=Number(w))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if("sourceIndex"in a||a.parentNode&&"sourceIndex"in a.parentNode){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?jb(a,b):!c&&hb(e,b)?-1*kb(a,b):!d&&hb(f,a)?kb(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=A(a);c=d.createRange();
|
|
38
38
|
c.selectNode(a);c.collapse(!0);a=d.createRange();a.selectNode(b);a.collapse(!0);return c.compareBoundaryPoints(aa.Range.START_TO_END,a)}function kb(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return jb(b,a)}function jb(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1}function A(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function lb(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}
|
|
39
39
|
function fb(a){this.a=a||aa.document||document}fb.prototype.getElementsByTagName=function(a,b){return(b||this.a).getElementsByTagName(String(a))};
|
|
@@ -43,44 +43,44 @@ function nb(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d)
|
|
|
43
43
|
function pb(a,b,c,d,e){if(a instanceof rb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=sb(a);if("*"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h++];)nb(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)"*"==a&&"!"==b.tagName||e.add(b);return e}tb(a,b,c,d,e);return e}
|
|
44
44
|
function qb(a,b,c,d,e){b.getElementsByName&&d&&"name"==c&&!t?(b=b.getElementsByName(d),l(b,function(f){a.a(f)&&e.add(f)})):b.getElementsByClassName&&d&&"class"==c?(b=b.getElementsByClassName(d),l(b,function(f){f.className==d&&a.a(f)&&e.add(f)})):a instanceof D?tb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),l(b,function(f){nb(f,c,d)&&e.add(f)}));return e}
|
|
45
45
|
function ub(a,b,c,d,e){var f;if((a instanceof rb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=sb(a);if("*"!=g&&(f=pa(f,function(h){return h.tagName&&h.tagName.toLowerCase()==g}),!f))return e;c&&(f=pa(f,function(h){return nb(h,c,d)}));l(f,function(h){"*"==g&&("!"==h.tagName||"*"==g&&1!=h.nodeType)||e.add(h)});return e}return vb(a,b,c,d,e)}function vb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)nb(b,c,d)&&a.a(b)&&e.add(b);return e}
|
|
46
|
-
function tb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)nb(b,c,d)&&a.a(b)&&e.add(b),tb(a,b,c,d,e)}function sb(a){if(a instanceof D){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function C(){this.b=this.a=null;this.
|
|
47
|
-
C.prototype.add=function(a){a=new wb(a);a.b=this.b;this.a?this.b.a=a:this.a=this.b=a;this.b=a;this.
|
|
46
|
+
function tb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)nb(b,c,d)&&a.a(b)&&e.add(b),tb(a,b,c,d,e)}function sb(a){if(a instanceof D){if(8==a.b)return"!";if(null===a.b)return"*"}return a.f()};function C(){this.b=this.a=null;this.o=0}function wb(a){this.f=a;this.a=this.b=null}function xb(a,b){if(!a.a)return b;if(!b.a)return a;var c=a.a;b=b.a;for(var d=null,e,f=0;c&&b;){e=c.f;var g=b.f;e==g||e instanceof Wa&&g instanceof Wa&&e.a==g.a?(e=c,c=c.a,b=b.a):0<ib(c.f,b.f)?(e=b,b=b.a):(e=c,c=c.a);(e.b=d)?d.a=e:a.a=e;d=e;f++}for(e=c||b;e;)e.b=d,d=d.a=e,f++,e=e.a;a.b=d;a.o=f;return a}function yb(a,b){b=new wb(b);b.a=a.a;a.b?a.a.b=b:a.a=a.b=b;a.a=b;a.o++}
|
|
47
|
+
C.prototype.add=function(a){a=new wb(a);a.b=this.b;this.a?this.b.a=a:this.a=this.b=a;this.b=a;this.o++};function zb(a){return(a=a.a)?a.f:null}function Bb(a){return(a=zb(a))?B(a):""}function Cb(a,b){return new Db(a,!!b)}function Db(a,b){this.f=a;this.b=(this.B=b)?a.b:a.a;this.a=null}function E(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.B?b.b:b.a;return c.f};function F(a){this.i=a;this.b=this.g=!1;this.f=null}function H(a){return"\n "+a.toString().split("\n").join("\n ")}function Eb(a,b){a.g=b}function Fb(a,b){a.b=b}function I(a,b){a=a.a(b);return a instanceof C?+Bb(a):+a}function J(a,b){a=a.a(b);return a instanceof C?Bb(a):""+a}function Gb(a,b){a=a.a(b);return a instanceof C?!!a.o:!!a};function Hb(a,b,c){F.call(this,a.i);this.c=a;this.h=b;this.A=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==Ib&&(c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,C:b}):this.f={name:b.f.name,C:c})}k(Hb,F);
|
|
48
48
|
function Jb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof C&&c instanceof C){b=Cb(b);for(d=E(b);d;d=E(b))for(e=Cb(c),f=E(e);f;f=E(e))if(a(B(d),B(f)))return!0;return!1}if(b instanceof C||c instanceof C){b instanceof C?(e=b,d=c):(e=c,d=b);f=Cb(e);for(var g=typeof d,h=E(f);h;h=E(f)){switch(g){case "number":h=+B(h);break;case "boolean":h=!!B(h);break;case "string":h=B(h);break;default:throw Error("Illegal primitive type for comparison.");}if(e==b&&a(h,d)||e==c&&a(d,h))return!0}return!1}return e?
|
|
49
|
-
"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Hb.prototype.a=function(a){return this.c.
|
|
49
|
+
"boolean"==typeof b||"boolean"==typeof c?a(!!b,!!c):"number"==typeof b||"number"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}Hb.prototype.a=function(a){return this.c.u(this.h,this.A,a)};Hb.prototype.toString=function(){var a="Binary Expression: "+this.c;a+=H(this.h);return a+=H(this.A)};function Kb(a,b,c,d){this.$=a;this.M=b;this.i=c;this.u=d}Kb.prototype.toString=function(){return this.$};var Lb={};
|
|
50
50
|
function K(a,b,c,d){if(Lb.hasOwnProperty(a))throw Error("Binary operator already created: "+a);a=new Kb(a,b,c,d);return Lb[a.toString()]=a}K("div",6,1,function(a,b,c){return I(a,c)/I(b,c)});K("mod",6,1,function(a,b,c){return I(a,c)%I(b,c)});K("*",6,1,function(a,b,c){return I(a,c)*I(b,c)});K("+",5,1,function(a,b,c){return I(a,c)+I(b,c)});K("-",5,1,function(a,b,c){return I(a,c)-I(b,c)});K("<",4,2,function(a,b,c){return Jb(function(d,e){return d<e},a,b,c)});
|
|
51
|
-
K(">",4,2,function(a,b,c){return Jb(function(d,e){return d>e},a,b,c)});K("<=",4,2,function(a,b,c){return Jb(function(d,e){return d<=e},a,b,c)});K(">=",4,2,function(a,b,c){return Jb(function(d,e){return d>=e},a,b,c)});var Ib=K("=",3,2,function(a,b,c){return Jb(function(d,e){return d==e},a,b,c,!0)});K("!=",3,2,function(a,b,c){return Jb(function(d,e){return d!=e},a,b,c,!0)});K("and",2,2,function(a,b,c){return Gb(a,c)&&Gb(b,c)});K("or",1,2,function(a,b,c){return Gb(a,c)||Gb(b,c)});function Mb(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");F.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}k(Mb,F);Mb.prototype.a=function(a){a=this.c.a(a);return Nb(this.h,a)};Mb.prototype.toString=function(){var a="Filter:"+H(this.c);return a+=H(this.h)};function Ob(a,b){if(b.length<a.L)throw Error("Function "+a.l+" expects at least"+a.L+" arguments, "+b.length+" given");if(null!==a.H&&b.length>a.H)throw Error("Function "+a.l+" expects at most "+a.H+" arguments, "+b.length+" given");a.Z&&l(b,function(c,d){if(4!=c.i)throw Error("Argument "+d+" to function "+a.l+" is not of type Nodeset: "+c);});F.call(this,a.i);this.
|
|
52
|
-
k(Ob,F);Ob.prototype.a=function(a){return this.
|
|
53
|
-
function L(a,b,c,d,e,f,g,h){if(Qb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Qb[a]=new Pb(a,b,c,d,e,f,g,h)}L("boolean",2,!1,!1,function(a,b){return Gb(b,a)},1);L("ceiling",1,!1,!1,function(a,b){return Math.ceil(I(b,a))},1);L("concat",3,!1,!1,function(a,b){return ra(wa(arguments,1),function(c,d){return c+J(d,a)},"")},2,null);L("contains",2,!1,!1,function(a,b,c){b=J(b,a);a=J(c,a);return a=-1!=b.indexOf(a)},2);L("count",1,!1,!1,function(a,b){return b.a(a).
|
|
54
|
-
L("false",2,!1,!1,function(){return!1},0);L("floor",1,!1,!1,function(a,b){return Math.floor(I(b,a))},1);L("id",4,!1,!1,function(a,b){function c(h){if(x){var
|
|
51
|
+
K(">",4,2,function(a,b,c){return Jb(function(d,e){return d>e},a,b,c)});K("<=",4,2,function(a,b,c){return Jb(function(d,e){return d<=e},a,b,c)});K(">=",4,2,function(a,b,c){return Jb(function(d,e){return d>=e},a,b,c)});var Ib=K("=",3,2,function(a,b,c){return Jb(function(d,e){return d==e},a,b,c,!0)});K("!=",3,2,function(a,b,c){return Jb(function(d,e){return d!=e},a,b,c,!0)});K("and",2,2,function(a,b,c){return Gb(a,c)&&Gb(b,c)});K("or",1,2,function(a,b,c){return Gb(a,c)||Gb(b,c)});function Mb(a,b){if(b.a.length&&4!=a.i)throw Error("Primary expression must evaluate to nodeset if filter has predicate(s).");F.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}k(Mb,F);Mb.prototype.a=function(a){a=this.c.a(a);return Nb(this.h,a)};Mb.prototype.toString=function(){var a="Filter:"+H(this.c);return a+=H(this.h)};function Ob(a,b){if(b.length<a.L)throw Error("Function "+a.l+" expects at least"+a.L+" arguments, "+b.length+" given");if(null!==a.H&&b.length>a.H)throw Error("Function "+a.l+" expects at most "+a.H+" arguments, "+b.length+" given");a.Z&&l(b,function(c,d){if(4!=c.i)throw Error("Argument "+d+" to function "+a.l+" is not of type Nodeset: "+c);});F.call(this,a.i);this.F=a;this.c=b;Eb(this,a.g||sa(b,function(c){return c.g}));Fb(this,a.Y&&!b.length||a.X&&!!b.length||sa(b,function(c){return c.b}))}
|
|
52
|
+
k(Ob,F);Ob.prototype.a=function(a){return this.F.u.apply(null,va(a,this.c))};Ob.prototype.toString=function(){var a="Function: "+this.F;if(this.c.length){var b=ra(this.c,function(c,d){return c+H(d)},"Arguments:");a+=H(b)}return a};function Pb(a,b,c,d,e,f,g,h){this.l=a;this.i=b;this.g=c;this.Y=d;this.X=!1;this.u=e;this.L=f;this.H=void 0!==g?g:f;this.Z=!!h}Pb.prototype.toString=function(){return this.l};var Qb={};
|
|
53
|
+
function L(a,b,c,d,e,f,g,h){if(Qb.hasOwnProperty(a))throw Error("Function already created: "+a+".");Qb[a]=new Pb(a,b,c,d,e,f,g,h)}L("boolean",2,!1,!1,function(a,b){return Gb(b,a)},1);L("ceiling",1,!1,!1,function(a,b){return Math.ceil(I(b,a))},1);L("concat",3,!1,!1,function(a,b){return ra(wa(arguments,1),function(c,d){return c+J(d,a)},"")},2,null);L("contains",2,!1,!1,function(a,b,c){b=J(b,a);a=J(c,a);return a=-1!=b.indexOf(a)},2);L("count",1,!1,!1,function(a,b){return b.a(a).o},1,1,!0);
|
|
54
|
+
L("false",2,!1,!1,function(){return!1},0);L("floor",1,!1,!1,function(a,b){return Math.floor(I(b,a))},1);L("id",4,!1,!1,function(a,b){function c(h){if(x){var p=e.all[h];if(p){if(p.nodeType&&h==p.id)return p;if(p.length)return ua(p,function(u){return h==u.id})}return null}return e.getElementById(h)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument;a=J(b,a).split(/\s+/);var f=[];l(a,function(h){h=c(h);!h||0<=oa(f,h)||f.push(h)});f.sort(ib);var g=new C;l(f,function(h){g.add(h)});return g},1);
|
|
55
55
|
L("lang",2,!1,!1,function(){return!1},1);L("last",1,!0,!1,function(a){if(1!=arguments.length)throw Error("Function last expects ()");return a.f},0);L("local-name",3,!1,!0,function(a,b){return(a=b?zb(b.a(a)):a.a)?a.localName||a.nodeName.toLowerCase():""},0,1,!0);L("name",3,!1,!0,function(a,b){return(a=b?zb(b.a(a)):a.a)?a.nodeName.toLowerCase():""},0,1,!0);L("namespace-uri",3,!0,!1,function(){return""},0,1,!0);
|
|
56
56
|
L("normalize-space",3,!1,!0,function(a,b){return(b?J(b,a):B(a.a)).replace(/[\s\xa0]+/g," ").replace(/^\s+|\s+$/g,"")},0,1);L("not",2,!1,!1,function(a,b){return!Gb(b,a)},1);L("number",1,!1,!0,function(a,b){return b?I(b,a):+B(a.a)},0,1);L("position",1,!0,!1,function(a){return a.b},0);L("round",1,!1,!1,function(a,b){return Math.round(I(b,a))},1);L("starts-with",2,!1,!1,function(a,b,c){b=J(b,a);a=J(c,a);return 0==b.lastIndexOf(a,0)},2);L("string",3,!1,!0,function(a,b){return b?J(b,a):B(a.a)},0,1);
|
|
57
57
|
L("string-length",1,!1,!0,function(a,b){return(b?J(b,a):B(a.a)).length},0,1);L("substring",3,!1,!1,function(a,b,c,d){c=I(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return"";d=d?I(d,a):Infinity;if(isNaN(d)||-Infinity===d)return"";c=Math.round(c)-1;var e=Math.max(c,0);a=J(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);L("substring-after",3,!1,!1,function(a,b,c){b=J(b,a);a=J(c,a);c=b.indexOf(a);return-1==c?"":b.substring(c+a.length)},2);
|
|
58
58
|
L("substring-before",3,!1,!1,function(a,b,c){b=J(b,a);a=J(c,a);a=b.indexOf(a);return-1==a?"":b.substring(0,a)},2);L("sum",1,!1,!1,function(a,b){a=Cb(b.a(a));b=0;for(var c=E(a);c;c=E(a))b+=+B(c);return b},1,1,!0);L("translate",3,!1,!1,function(a,b,c,d){b=J(b,a);c=J(c,a);var e=J(d,a);a={};for(d=0;d<c.length;d++){var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c="";for(d=0;d<b.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);L("true",2,!1,!1,function(){return!0},0);function D(a,b){this.h=a;this.c=void 0!==b?b:null;this.b=null;switch(a){case "comment":this.b=8;break;case "text":this.b=3;break;case "processing-instruction":this.b=7;break;case "node":break;default:throw Error("Unexpected argument");}}function Rb(a){return"comment"==a||"text"==a||"processing-instruction"==a||"node"==a}D.prototype.a=function(a){return null===this.b||this.b==a.nodeType};D.prototype.f=function(){return this.h};
|
|
59
59
|
D.prototype.toString=function(){var a="Kind Test: "+this.h;null===this.c||(a+=H(this.c));return a};function Sb(a){F.call(this,3);this.c=a.substring(1,a.length-1)}k(Sb,F);Sb.prototype.a=function(){return this.c};Sb.prototype.toString=function(){return"Literal: "+this.c};function rb(a,b){this.l=a.toLowerCase();a="*"==this.l?"*":"http://www.w3.org/1999/xhtml";this.c=b?b.toLowerCase():a}rb.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=void 0!==a.localName?a.localName:a.nodeName;return"*"!=this.l&&this.l!=b.toLowerCase()?!1:"*"==this.c?!0:this.c==(a.namespaceURI?a.namespaceURI.toLowerCase():"http://www.w3.org/1999/xhtml")};rb.prototype.f=function(){return this.l};
|
|
60
|
-
rb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.l};function Tb(a){F.call(this,1);this.c=a}k(Tb,F);Tb.prototype.a=function(){return this.c};Tb.prototype.toString=function(){return"Number: "+this.c};function Ub(a,b){F.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;1==this.c.length&&(a=this.c[0],a.G||a.c!=Vb||(a=a.
|
|
61
|
-
function Yb(a){return"/"==a||"//"==a}Ub.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof C))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.
|
|
62
|
-
Ub.prototype.toString=function(){var a="Path Expression:"+H(this.h);if(this.c.length){var b=ra(this.c,function(c,d){return c+H(d)},"Steps:");a+=H(b)}return a};function ac(a,b){this.a=a;this.
|
|
63
|
-
function Nb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=Cb(b),f=b.
|
|
64
|
-
ac.prototype.toString=function(){return ra(this.a,function(a,b){return a+H(b)},"Predicates:")};function bc(a,b,c,d){F.call(this,4);this.c=a;this.
|
|
65
|
-
bc.prototype.a=function(a){var b=a.a,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.
|
|
66
|
-
bc.prototype.toString=function(){var a="Step:"+H("Operator: "+(this.G?"//":"/"));this.c.l&&(a+=H("Axis: "+this.c));a+=H(this.
|
|
60
|
+
rb.prototype.toString=function(){return"Name Test: "+("http://www.w3.org/1999/xhtml"==this.c?"":this.c+":")+this.l};function Tb(a){F.call(this,1);this.c=a}k(Tb,F);Tb.prototype.a=function(){return this.c};Tb.prototype.toString=function(){return"Number: "+this.c};function Ub(a,b){F.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;1==this.c.length&&(a=this.c[0],a.G||a.c!=Vb||(a=a.A,"*"!=a.f()&&(this.f={name:a.f(),C:null})))}k(Ub,F);function Wb(){F.call(this,4)}k(Wb,F);Wb.prototype.a=function(a){var b=new C;a=a.a;9==a.nodeType?b.add(a):b.add(a.ownerDocument);return b};Wb.prototype.toString=function(){return"Root Helper Expression"};function Xb(){F.call(this,4)}k(Xb,F);Xb.prototype.a=function(a){var b=new C;b.add(a.a);return b};Xb.prototype.toString=function(){return"Context Helper Expression"};
|
|
61
|
+
function Yb(a){return"/"==a||"//"==a}Ub.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof C))throw Error("Filter expression must evaluate to nodeset.");a=this.c;for(var c=0,d=a.length;c<d&&b.o;c++){var e=a[c],f=Cb(b,e.c.B);if(e.g||e.c!=Zb)if(e.g||e.c!=$b){var g=E(f);for(b=e.a(new ma(g));null!=(g=E(f));)g=e.a(new ma(g)),b=xb(b,g)}else g=E(f),b=e.a(new ma(g));else{for(g=E(f);(b=E(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new ma(g))}}return b};
|
|
62
|
+
Ub.prototype.toString=function(){var a="Path Expression:"+H(this.h);if(this.c.length){var b=ra(this.c,function(c,d){return c+H(d)},"Steps:");a+=H(b)}return a};function ac(a,b){this.a=a;this.B=!!b}
|
|
63
|
+
function Nb(a,b,c){for(c=c||0;c<a.a.length;c++)for(var d=a.a[c],e=Cb(b),f=b.o,g,h=0;g=E(e);h++){var p=a.B?f-h:h+1;g=d.a(new ma(g,p,f));if("number"==typeof g)p=p==g;else if("string"==typeof g||"boolean"==typeof g)p=!!g;else if(g instanceof C)p=0<g.o;else throw Error("Predicate.evaluate returned an unexpected type.");if(!p){p=e;g=p.f;var u=p.a;if(!u)throw Error("Next must be called at least once before remove.");var q=u.b;u=u.a;q?q.a=u:g.a=u;u?u.b=q:g.b=q;g.o--;p.a=null}}return b}
|
|
64
|
+
ac.prototype.toString=function(){return ra(this.a,function(a,b){return a+H(b)},"Predicates:")};function bc(a,b,c,d){F.call(this,4);this.c=a;this.A=b;this.h=c||new ac([]);this.G=!!d;b=this.h;b=0<b.a.length?b.a[0].f:null;a.ga&&b&&(a=b.name,a=x?a.toLowerCase():a,this.f={name:a,C:b.C});a:{a=this.h;for(b=0;b<a.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}k(bc,F);
|
|
65
|
+
bc.prototype.a=function(a){var b=a.a,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.C?J(c.C,a):null,f=1);if(this.G)if(this.g||this.c!=cc)if(b=Cb((new bc(dc,new D("node"))).a(a)),c=E(b))for(a=this.u(c,d,e,f);null!=(c=E(b));)a=xb(a,this.u(c,d,e,f));else a=new C;else a=ob(this.A,b,d,e),a=Nb(this.h,a,f);else a=this.u(a.a,d,e,f);return a};bc.prototype.u=function(a,b,c,d){a=this.c.F(this.A,a,b,c);return a=Nb(this.h,a,d)};
|
|
66
|
+
bc.prototype.toString=function(){var a="Step:"+H("Operator: "+(this.G?"//":"/"));this.c.l&&(a+=H("Axis: "+this.c));a+=H(this.A);if(this.h.a.length){var b=ra(this.h.a,function(c,d){return c+H(d)},"Predicates:");a+=H(b)}return a};function ec(a,b,c,d){this.l=a;this.F=b;this.B=c;this.ga=d}ec.prototype.toString=function(){return this.l};var fc={};function M(a,b,c,d){if(fc.hasOwnProperty(a))throw Error("Axis already created: "+a);b=new ec(a,b,c,!!d);return fc[a]=b}
|
|
67
67
|
M("ancestor",function(a,b){for(var c=new C;b=b.parentNode;)a.a(b)&&yb(c,b);return c},!0);M("ancestor-or-self",function(a,b){var c=new C;do a.a(b)&&yb(c,b);while(b=b.parentNode);return c},!0);
|
|
68
68
|
var Vb=M("attribute",function(a,b){var c=new C,d=a.f();if("style"==d&&x&&b.style)return c.add(new Wa(b.style,b,"style",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof D&&null===a.b||"*"==d)for(a=0;d=e[a];a++)x?d.nodeValue&&c.add(Xa(b,d)):c.add(d);else(d=e.getNamedItem(d))&&(x?d.nodeValue&&c.add(Xa(b,d)):c.add(d));return c},!1),cc=M("child",function(a,b,c,d,e){return(x?ub:vb).call(null,a,b,ba(c)?c:null,ba(d)?d:null,e||new C)},!1,!0);M("descendant",ob,!1,!0);
|
|
69
69
|
var dc=M("descendant-or-self",function(a,b,c,d){var e=new C;nb(b,c,d)&&a.a(b)&&e.add(b);return ob(a,b,c,d,e)},!1,!0),Zb=M("following",function(a,b,c,d){var e=new C;do for(var f=b;f=f.nextSibling;)nb(f,c,d)&&a.a(f)&&e.add(f),e=ob(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);M("following-sibling",function(a,b){for(var c=new C;b=b.nextSibling;)a.a(b)&&c.add(b);return c},!1);M("namespace",function(){return new C},!1);
|
|
70
|
-
var gc=M("parent",function(a,b){var c=new C;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;b=b.parentNode;a.a(b)&&c.add(b);return c},!1),$b=M("preceding",function(a,b,c,d){var e=new C,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var
|
|
70
|
+
var gc=M("parent",function(a,b){var c=new C;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;b=b.parentNode;a.a(b)&&c.add(b);return c},!1),$b=M("preceding",function(a,b,c,d){var e=new C,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g<h;g++){var p=[];for(b=f[g];b=b.previousSibling;)p.unshift(b);for(var u=0,q=p.length;u<q;u++)b=p[u],nb(b,c,d)&&a.a(b)&&e.add(b),e=ob(a,b,c,d,e)}return e},!0,!0);
|
|
71
71
|
M("preceding-sibling",function(a,b){for(var c=new C;b=b.previousSibling;)a.a(b)&&yb(c,b);return c},!0);var hc=M("self",function(a,b){var c=new C;a.a(b)&&c.add(b);return c},!1);function ic(a){F.call(this,1);this.c=a;this.g=a.g;this.b=a.b}k(ic,F);ic.prototype.a=function(a){return-I(this.c,a)};ic.prototype.toString=function(){return"Unary Expression: -"+H(this.c)};function jc(a){F.call(this,4);this.c=a;Eb(this,sa(this.c,function(b){return b.g}));Fb(this,sa(this.c,function(b){return b.b}))}k(jc,F);jc.prototype.a=function(a){var b=new C;l(this.c,function(c){c=c.a(a);if(!(c instanceof C))throw Error("Path expression must evaluate to NodeSet.");b=xb(b,c)});return b};jc.prototype.toString=function(){return ra(this.c,function(a,b){return a+H(b)},"Union Expression:")};function kc(a,b){this.a=a;this.b=b}function lc(a){for(var b,c=[];;){N(a,"Missing right hand side of binary expression.");b=mc(a);var d=z(a.a);if(!d)break;var e=(d=Lb[d]||null)&&d.M;if(!e){a.a.a--;break}for(;c.length&&e<=c[c.length-1].M;)b=new Hb(c.pop(),c.pop(),b);c.push(b,d)}for(;c.length;)b=new Hb(c.pop(),c.pop(),b);return b}function N(a,b){if(bb(a.a))throw Error(b);}function nc(a,b){a=z(a.a);if(a!=b)throw Error("Bad token, expected: "+b+" got: "+a);}
|
|
72
72
|
function oc(a){a=z(a.a);if(")"!=a)throw Error("Bad token: "+a);}function rc(a){a=z(a.a);if(2>a.length)throw Error("Unclosed literal string");return new Sb(a)}
|
|
73
73
|
function sc(a){var b=[];if(Yb(y(a.a))){var c=z(a.a);var d=y(a.a);if("/"==c&&(bb(a.a)||"."!=d&&".."!=d&&"@"!=d&&"*"!=d&&!/(?![0-9])[\w]/.test(d)))return new Wb;d=new Wb;N(a,"Missing next location step.");c=tc(a,c);b.push(c)}else{a:{c=y(a.a);d=c.charAt(0);switch(d){case "$":throw Error("Variable reference not allowed in HTML XPath");case "(":z(a.a);c=lc(a);N(a,'unclosed "("');nc(a,")");break;case '"':case "'":c=rc(a);break;default:if(isNaN(+c))if(!Rb(c)&&/(?![0-9])[\w]/.test(d)&&"("==y(a.a,1)){c=z(a.a);
|
|
74
74
|
c=Qb[c]||null;z(a.a);for(d=[];")"!=y(a.a);){N(a,"Missing function argument list.");d.push(lc(a));if(","!=y(a.a))break;z(a.a)}N(a,"Unclosed function argument list.");oc(a);c=new Ob(c,d)}else{c=null;break a}else c=new Tb(+z(a.a))}"["==y(a.a)&&(d=new ac(uc(a)),c=new Mb(c,d))}if(c)if(Yb(y(a.a)))d=c;else return c;else c=tc(a,"/"),d=new Xb,b.push(c)}for(;Yb(y(a.a));)c=z(a.a),N(a,"Missing next location step."),c=tc(a,c),b.push(c);return new Ub(d,b)}
|
|
75
75
|
function tc(a,b){if("/"!=b&&"//"!=b)throw Error('Step op should be "/" or "//"');if("."==y(a.a)){var c=new bc(hc,new D("node"));z(a.a);return c}if(".."==y(a.a))return c=new bc(gc,new D("node")),z(a.a),c;if("@"==y(a.a)){var d=Vb;z(a.a);N(a,"Missing attribute name")}else if("::"==y(a.a,1)){if(!/(?![0-9])[\w]/.test(y(a.a).charAt(0)))throw Error("Bad token: "+z(a.a));var e=z(a.a);d=fc[e]||null;if(!d)throw Error("No axis with name: "+e);z(a.a);N(a,"Missing node name")}else d=cc;e=y(a.a);if(/(?![0-9])[\w\*]/.test(e.charAt(0)))if("("==
|
|
76
|
-
y(a.a,1)){if(!Rb(e))throw Error("Invalid node type: "+e);e=z(a.a);if(!Rb(e))throw Error("Invalid type name: "+e);nc(a,"(");N(a,"Bad nodetype");var f=y(a.a).charAt(0),g=null;if('"'==f||"'"==f)g=rc(a);N(a,"Bad nodetype");oc(a);e=new D(e,g)}else if(e=z(a.a),f=e.indexOf(":"),-1==f)e=new rb(e);else{g=e.substring(0,f);if("*"==g)var h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);e=e.substr(f+1);e=new rb(e,h)}else throw Error("Bad token: "+z(a.a));a=new ac(uc(a),d.
|
|
76
|
+
y(a.a,1)){if(!Rb(e))throw Error("Invalid node type: "+e);e=z(a.a);if(!Rb(e))throw Error("Invalid type name: "+e);nc(a,"(");N(a,"Bad nodetype");var f=y(a.a).charAt(0),g=null;if('"'==f||"'"==f)g=rc(a);N(a,"Bad nodetype");oc(a);e=new D(e,g)}else if(e=z(a.a),f=e.indexOf(":"),-1==f)e=new rb(e);else{g=e.substring(0,f);if("*"==g)var h="*";else if(h=a.b(g),!h)throw Error("Namespace prefix not declared: "+g);e=e.substr(f+1);e=new rb(e,h)}else throw Error("Bad token: "+z(a.a));a=new ac(uc(a),d.B);return c||
|
|
77
77
|
new bc(d,e,a,"//"==b)}function uc(a){for(var b=[];"["==y(a.a);){z(a.a);N(a,"Missing predicate expression.");var c=lc(a);b.push(c);N(a,"Unclosed predicate expression.");nc(a,"]")}return b}function mc(a){if("-"==y(a.a))return z(a.a),new ic(mc(a));var b=sc(a);if("|"!=y(a.a))a=b;else{for(b=[b];"|"==z(a.a);)N(a,"Missing next union location path."),b.push(sc(a));a.a.a--;a=new jc(b)}return a};function vc(a){switch(a.nodeType){case 1:return la(wc,a);case 9:return vc(a.documentElement);case 11:case 10:case 6:case 12:return xc;default:return a.parentNode?vc(a.parentNode):xc}}function xc(){return null}function wc(a,b){if(a.prefix==b)return a.namespaceURI||"http://www.w3.org/1999/xhtml";var c=a.getAttributeNode("xmlns:"+b);return c&&c.specified?c.value||null:a.parentNode&&9!=a.parentNode.nodeType?wc(a.parentNode,b):null};function yc(a,b){if(!a.length)throw Error("Empty XPath expression.");a=Za(a);if(bb(a))throw Error("Invalid XPath expression.");b?ea(b)||(b=ka(b.lookupNamespaceURI,b)):b=function(){return null};var c=lc(new kc(a,b));if(!bb(a))throw Error("Bad token: "+z(a));this.evaluate=function(d,e){d=c.a(new ma(d));return new O(d,e)}}
|
|
78
|
-
function O(a,b){if(0==b)if(a instanceof C)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof C))throw Error("value could not be converted to the specified type");this.resultType=b;switch(b){case 2:this.stringValue=a instanceof C?Bb(a):""+a;break;case 1:this.numberValue=a instanceof C?+Bb(a):+a;break;case 3:this.booleanValue=a instanceof C?0<a.
|
|
79
|
-
Cb(a);var d=[];for(var e=E(c);e;e=E(c))d.push(e instanceof Wa?e.a:e);this.snapshotLength=a.
|
|
78
|
+
function O(a,b){if(0==b)if(a instanceof C)b=4;else if("string"==typeof a)b=2;else if("number"==typeof a)b=1;else if("boolean"==typeof a)b=3;else throw Error("Unexpected evaluation result.");if(2!=b&&1!=b&&3!=b&&!(a instanceof C))throw Error("value could not be converted to the specified type");this.resultType=b;switch(b){case 2:this.stringValue=a instanceof C?Bb(a):""+a;break;case 1:this.numberValue=a instanceof C?+Bb(a):+a;break;case 3:this.booleanValue=a instanceof C?0<a.o:!!a;break;case 4:case 5:case 6:case 7:var c=
|
|
79
|
+
Cb(a);var d=[];for(var e=E(c);e;e=E(c))d.push(e instanceof Wa?e.a:e);this.snapshotLength=a.o;this.invalidIteratorState=!1;break;case 8:case 9:a=zb(a);this.singleNodeValue=a instanceof Wa?a.a:a;break;default:throw Error("Unknown XPathResult type.");}var f=0;this.iterateNext=function(){if(4!=b&&5!=b)throw Error("iterateNext called with wrong result type");return f>=d.length?null:d[f++]};this.snapshotItem=function(g){if(6!=b&&7!=b)throw Error("snapshotItem called with wrong result type");return g>=d.length||
|
|
80
80
|
0>g?null:d[g]}}O.ANY_TYPE=0;O.NUMBER_TYPE=1;O.STRING_TYPE=2;O.BOOLEAN_TYPE=3;O.UNORDERED_NODE_ITERATOR_TYPE=4;O.ORDERED_NODE_ITERATOR_TYPE=5;O.UNORDERED_NODE_SNAPSHOT_TYPE=6;O.ORDERED_NODE_SNAPSHOT_TYPE=7;O.ANY_UNORDERED_NODE_TYPE=8;O.FIRST_ORDERED_NODE_TYPE=9;function zc(a){this.lookupNamespaceURI=vc(a)}
|
|
81
81
|
function Ac(a,b){a=a||aa;var c=a.Document&&a.Document.prototype||a.document;if(!c.evaluate||b)a.XPathResult=O,c.evaluate=function(d,e,f,g){return(new yc(d,f)).evaluate(e,g)},c.createExpression=function(d,e){return new yc(d,e)},c.createNSResolver=function(d){return new zc(d)}}ca("wgxpath.install",Ac);ca("wgxpath.install",Ac);var Bc=window;function P(a,b){this.code=a;this.a=Q[a]||Cc;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||""}k(P,Error);var Cc="unknown error",Q={15:"element not selectable",11:"element not visible"};Q[31]=Cc;Q[30]=Cc;Q[24]="invalid cookie domain";Q[29]="invalid element coordinates";Q[12]="invalid element state";
|
|
82
|
-
Q[32]="invalid selector";Q[51]="invalid selector";Q[52]="invalid selector";Q[17]="javascript error";Q[405]="unsupported operation";Q[34]="move target out of bounds";Q[27]="no such alert";Q[7]="no such element";Q[8]="no such frame";Q[23]="no such window";Q[28]="script timeout";Q[33]="session not created";Q[10]="stale element reference";Q[21]="timeout";Q[25]="unable to set cookie";Q[26]="unexpected alert open";Q[13]=Cc;Q[9]="unknown command";var Dc={
|
|
83
|
-
"Compound class names not permitted");if(Dc.
|
|
82
|
+
Q[32]="invalid selector";Q[51]="invalid selector";Q[52]="invalid selector";Q[17]="javascript error";Q[405]="unsupported operation";Q[34]="move target out of bounds";Q[27]="no such alert";Q[7]="no such element";Q[8]="no such frame";Q[23]="no such window";Q[28]="script timeout";Q[33]="session not created";Q[10]="stale element reference";Q[21]="timeout";Q[25]="unable to set cookie";Q[26]="unexpected alert open";Q[13]=Cc;Q[9]="unknown command";var Dc={D:function(a){return!(!a.querySelectorAll||!a.querySelector)},s:function(a,b){if(!a)throw new P(32,"No class name specified");a=Aa(a);if(-1!==a.indexOf(" "))throw new P(32,"Compound class names not permitted");if(Dc.D(b))try{return b.querySelector("."+a.replace(/\./g,"\\."))||null}catch(c){throw new P(32,"An invalid or illegal class name was specified");}a=mb(eb(b),"*",a,b);return a.length?a[0]:null},j:function(a,b){if(!a)throw new P(32,"No class name specified");a=Aa(a);if(-1!==a.indexOf(" "))throw new P(32,
|
|
83
|
+
"Compound class names not permitted");if(Dc.D(b))try{return b.querySelectorAll("."+a.replace(/\./g,"\\."))}catch(c){throw new P(32,"An invalid or illegal class name was specified");}return mb(eb(b),"*",a,b)}};var Ec=Fa(),Fc=Ia()||r("iPod"),Gc=r("iPad"),Hc=r("Android")&&!(Ga()||Fa()||r("Opera")||r("Silk")),Ic=Ga(),Jc=r("Safari")&&!(Ga()||r("Coast")||r("Opera")||r("Edge")||r("Edg/")||r("OPR")||Fa()||r("Silk")||r("Android"))&&!(Ia()||r("iPad")||r("iPod"));function Kc(a){return(a=a.exec(m))?a[1]:""}(function(){if(Ec)return Kc(/Firefox\/([0-9.]+)/);if(t||Ma||La)return Qa;if(Ic)return Ia()||r("iPad")||r("iPod")?Kc(/CriOS\/([0-9.]+)/):Kc(/Chrome\/([0-9.]+)/);if(Jc&&!(Ia()||r("iPad")||r("iPod")))return Kc(/Version\/([0-9.]+)/);if(Fc||Gc){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(m);if(a)return a[1]+"."+a[2]}else if(Hc)return(a=Kc(/Android\s+([0-9.]+)/))?a:Kc(/Version\/([0-9.]+)/);return""})();var Lc=t&&!(8<=Number(w)),Mc=t&&!(9<=Number(w));var Nc={s:function(a,b){if(!ea(b.querySelector)&&t&&(t?0<=Ba(w,8):Ua(8))&&!ha(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new P(32,"No selector specified");a=Aa(a);try{var c=b.querySelector(a)}catch(d){throw new P(32,"An invalid or illegal selector was specified");}return c&&1==c.nodeType?c:null},j:function(a,b){if(!ea(b.querySelectorAll)&&t&&(t?0<=Ba(w,8):Ua(8))&&!ha(b.querySelector))throw Error("CSS selection is not supported");if(!a)throw new P(32,"No selector specified");
|
|
84
84
|
a=Aa(a);try{return b.querySelectorAll(a)}catch(c){throw new P(32,"An invalid or illegal selector was specified");}}};var Oc={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",
|
|
85
85
|
darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",
|
|
86
86
|
ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",
|
|
@@ -92,32 +92,34 @@ T.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b)
|
|
|
92
92
|
function U(a,b){b=Ha(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=Mc?"styleFloat":"cssFloat";a:{var c=b;var d=A(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||$c(a,b);if(null===a)a=null;else if(0<=oa(Pc,b)){b:{var e=a.match(Sc);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(Tc))if(b=
|
|
93
93
|
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=Oc[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(Qc,"#$1$1$2$2$3$3")),!Rc.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}
|
|
94
94
|
function $c(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&ea(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(a=Zc(a))?$c(a,b):null}
|
|
95
|
-
function ad(a,b,c){function d(g){var h=V(g);return 0<h.height&&0<h.width?!0:S(g,"PATH")&&(0<h.height||0<h.width)?(g=U(g,"stroke-width"),!!g&&0<parseInt(g,10)):"hidden"!=U(g,"overflow")&&sa(g.childNodes,function(
|
|
95
|
+
function ad(a,b,c){function d(g){var h=V(g);return 0<h.height&&0<h.width?!0:S(g,"PATH")&&(0<h.height||0<h.width)?(g=U(g,"stroke-width"),!!g&&0<parseInt(g,10)):"hidden"!=U(g,"overflow")&&sa(g.childNodes,function(p){return 3==p.nodeType||S(p)&&d(p)})}function e(g){return bd(g)==W&&ta(g.childNodes,function(h){return!S(h)||e(h)||!d(h)})}if(!S(a))throw Error("Argument to isShown must be of type Element");if(S(a,"BODY"))return!0;if(S(a,"OPTION")||S(a,"OPTGROUP"))return a=lb(a,function(g){return S(g,"SELECT")}),
|
|
96
96
|
!!a&&ad(a,!0,c);var f=cd(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&ad(f.image,b,c);if(S(a,"INPUT")&&"hidden"==a.type.toLowerCase()||S(a,"NOSCRIPT"))return!1;f=U(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=dd(a))&&d(a)?!e(a):!1}
|
|
97
97
|
function ed(a){function b(c){if(S(c)&&"none"==U(c,"display"))return!1;var d;if((d=c.parentNode)&&d.shadowRoot&&void 0!==c.assignedSlot)d=c.assignedSlot?c.assignedSlot.parentNode:null;else if(c.getDestinationInsertionPoints){var e=c.getDestinationInsertionPoints();0<e.length&&(d=e[e.length-1])}if(Yc&&d instanceof ShadowRoot){if(d.host.shadowRoot&&d.host.shadowRoot!==d)return!1;d=d.host}return!d||9!=d.nodeType&&11!=d.nodeType?d&&S(d,"DETAILS")&&!d.open&&!S(c,"SUMMARY")?!1:!!d&&b(d):!0}return ad(a,!1,
|
|
98
98
|
b)}var W="hidden";
|
|
99
|
-
function bd(a){function b(
|
|
100
|
-
function d(
|
|
101
|
-
|
|
99
|
+
function bd(a){function b(n){function v(Ab){if(Ab==g)return!0;var pc=U(Ab,"display");return 0==pc.lastIndexOf("inline",0)||"contents"==pc||"absolute"==qc&&"static"==U(Ab,"position")?!1:!0}var qc=U(n,"position");if("fixed"==qc)return u=!0,n==g?null:g;for(n=Zc(n);n&&!v(n);)n=Zc(n);return n}function c(n){var v=n;if("visible"==p)if(n==g&&h)v=h;else if(n==h)return{x:"visible",y:"visible"};v={x:U(v,"overflow-x"),y:U(v,"overflow-y")};n==g&&(v.x="visible"==v.x?"auto":v.x,v.y="visible"==v.y?"auto":v.y);return v}
|
|
100
|
+
function d(n){if(n==g){var v=(new fb(f)).a;n=v.scrollingElement?v.scrollingElement:Oa||"CSS1Compat"!=v.compatMode?v.body||v.documentElement:v.documentElement;v=v.parentWindow||v.defaultView;n=t&&Ua("10")&&v.pageYOffset!=n.scrollTop?new cb(n.scrollLeft,n.scrollTop):new cb(v.pageXOffset||n.scrollLeft,v.pageYOffset||n.scrollTop)}else n=new cb(n.scrollLeft,n.scrollTop);return n}var e=fd(a),f=A(a),g=f.documentElement,h=f.body,p=U(g,"overflow"),u;for(a=b(a);a;a=b(a)){var q=c(a);if("visible"!=q.x||"visible"!=
|
|
101
|
+
q.y){var G=V(a);if(0==G.width||0==G.height)return W;var R=e.a<G.a,fa=e.b<G.b;if(R&&"hidden"==q.x||fa&&"hidden"==q.y)return W;if(R&&"visible"!=q.x||fa&&"visible"!=q.y){R=d(a);fa=e.b<G.b-R.y;if(e.a<G.a-R.x&&"visible"!=q.x||fa&&"visible"!=q.x)return W;e=bd(a);return e==W?W:"scroll"}R=e.f>=G.a+G.width;G=e.c>=G.b+G.height;if(R&&"hidden"==q.x||G&&"hidden"==q.y)return W;if(R&&"visible"!=q.x||G&&"visible"!=q.y){if(u&&(q=d(a),e.f>=g.scrollWidth-q.x||e.a>=g.scrollHeight-q.y))return W;e=bd(a);return e==W?W:
|
|
102
102
|
"scroll"}}}return"none"}
|
|
103
103
|
function V(a){var b=cd(a);if(b)return b.rect;if(S(a,"HTML"))return a=A(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new db(a.clientWidth,a.clientHeight),new T(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new T(0,0,0,0)}b=new T(c.left,c.top,c.right-c.left,c.bottom-c.top);t&&a.ownerDocument.body&&(a=A(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop);
|
|
104
|
-
return b}function cd(a){var b=S(a,"MAP");if(!b&&!S(a,"AREA"))return null;var c=b?a:S(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=Nc.
|
|
104
|
+
return b}function cd(a){var b=S(a,"MAP");if(!b&&!S(a,"AREA"))return null;var c=b?a:S(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=Nc.s('*[usemap="#'+c.name+'"]',A(c)))&&(e=V(d),b||"default"==a.shape.toLowerCase()||(a=gd(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new T(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 T(0,0,0,0)}}
|
|
105
105
|
function gd(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 T(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new T(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 T(b,c,d-b,e-c)}return new T(0,0,0,0)}function fd(a){a=V(a);return new Xc(a.b,a.a+a.width,a.b+a.height,a.a)}
|
|
106
106
|
function hd(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function id(a){var b=[];Yc?jd(a,b):kd(a,b);a=qa(b,hd);return hd(a.join("\n")).replace(/\xa0/g," ")}
|
|
107
|
-
function ld(a,b,c){if(S(a,"BR"))b.push("");else{var d=S(a,"TD"),e=U(a,"display"),f=!d&&!(0<=oa(md,e)),g=void 0!==a.previousElementSibling?a.previousElementSibling:gb(a.previousSibling);g=g?U(g,"display"):"";var h=U(a,"float")||U(a,"cssFloat")||U(a,"styleFloat");!f||"run-in"==g&&"none"==h||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var
|
|
107
|
+
function ld(a,b,c){if(S(a,"BR"))b.push("");else{var d=S(a,"TD"),e=U(a,"display"),f=!d&&!(0<=oa(md,e)),g=void 0!==a.previousElementSibling?a.previousElementSibling:gb(a.previousSibling);g=g?U(g,"display"):"";var h=U(a,"float")||U(a,"cssFloat")||U(a,"styleFloat");!f||"run-in"==g&&"none"==h||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var p=ed(a),u=null,q=null;p&&(u=U(a,"white-space"),q=U(a,"text-transform"));l(a.childNodes,function(G){c(G,b,p,u,q)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||
|
|
108
108
|
za(a)||(b[b.length-1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function kd(a,b){ld(a,b,function(c,d,e,f,g){3==c.nodeType&&e?nd(c,d,f,g):S(c)&&kd(c,d)})}var md="inline inline-block inline-table none table-cell table-column table-column-group".split(" ");
|
|
109
109
|
function nd(a,b,c,d){a=a.nodeValue.replace(/[\u200b\u200e\u200f]/g,"");a=a.replace(/(\r\n|\r|\n)/g,"\n");if("normal"==c||"nowrap"==c)a=a.replace(/\n/g," ");a="pre"==c||"pre-wrap"==c?a.replace(/[ \f\t\v\u2028\u2029]/g,"\u00a0"):a.replace(/[ \f\t\v\u2028\u2029]+/g," ");"capitalize"==d?a=a.replace(t?/(^|\s|\b)(\S)/g:/(^|\s|\b)(\S)/gu,function(e,f,g){return f+g.toUpperCase()}):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";za(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));
|
|
110
110
|
b.push(c+a)}function dd(a){if(Mc){if("relative"==U(a,"position"))return 1;a=U(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return od(a)}function od(a){var b=1,c=U(a,"opacity");c&&(b=Number(c));(a=Zc(a))&&(b*=od(a));return b}
|
|
111
111
|
function pd(a,b,c,d,e){if(3==a.nodeType&&c)nd(a,b,d,e);else if(S(a))if(S(a,"CONTENT")||S(a,"SLOT")){for(var f=a;f.parentNode;)f=f.parentNode;f instanceof ShadowRoot?(f=S(a,"CONTENT")?a.getDistributedNodes():a.assignedNodes(),l(0<f.length?f:a.childNodes,function(g){pd(g,b,c,d,e)})):jd(a,b)}else if(S(a,"SHADOW")){for(f=a;f.parentNode;)f=f.parentNode;if(f instanceof ShadowRoot&&(a=f))for(a=a.olderShadowRoot;a;)l(a.childNodes,function(g){pd(g,b,c,d,e)}),a=a.olderShadowRoot}else jd(a,b)}
|
|
112
|
-
function jd(a,b){a.shadowRoot&&l(a.shadowRoot.childNodes,function(c){pd(c,b,!0,null,null)});ld(a,b,function(c,d,e,f,g){var h=null;1==c.nodeType?h=c:3==c.nodeType&&(h=c);null!=h&&(null!=h.assignedSlot||h.getDestinationInsertionPoints&&0<h.getDestinationInsertionPoints().length)||pd(c,d,e,f,g)})};var qd={
|
|
113
|
-
"\\$1")}};var X={},rd={};X.N=function(a,b,c){try{var d=Nc.j("a",b)}catch(e){d=mb(eb(b),"A",null,b)}return ua(d,function(e){e=id(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};X.K=function(a,b,c){try{var d=Nc.j("a",b)}catch(e){d=mb(eb(b),"A",null,b)}return pa(d,function(e){e=id(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};X.
|
|
114
|
-
rd.j=function(a,b){return X.K(a,b,!0)};var Y={
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
Y.
|
|
118
|
-
Y.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
Z.
|
|
122
|
-
|
|
112
|
+
function jd(a,b){a.shadowRoot&&l(a.shadowRoot.childNodes,function(c){pd(c,b,!0,null,null)});ld(a,b,function(c,d,e,f,g){var h=null;1==c.nodeType?h=c:3==c.nodeType&&(h=c);null!=h&&(null!=h.assignedSlot||h.getDestinationInsertionPoints&&0<h.getDestinationInsertionPoints().length)||pd(c,d,e,f,g)})};var qd={D:function(a,b){return!(!a.querySelectorAll||!a.querySelector)&&!/^\d.*/.test(b)},s:function(a,b){var c=eb(b),d="string"===typeof a?c.a.getElementById(a):a;return d?Uc(d,"id")==a&&b!=d&&hb(b,d)?d:ua(mb(c,"*"),function(e){return Uc(e,"id")==a&&b!=e&&hb(b,e)}):null},j:function(a,b){if(!a)return[];if(qd.D(b,a))try{return b.querySelectorAll("#"+qd.T(a))}catch(c){return[]}b=mb(eb(b),"*",null,b);return pa(b,function(c){return Uc(c,"id")==a})},T:function(a){return a.replace(/([\s'"\\#.:;,!?+<>=~*^$|%&@`{}\-\/\[\]\(\)])/g,
|
|
113
|
+
"\\$1")}};var X={},rd={};X.N=function(a,b,c){try{var d=Nc.j("a",b)}catch(e){d=mb(eb(b),"A",null,b)}return ua(d,function(e){e=id(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};X.K=function(a,b,c){try{var d=Nc.j("a",b)}catch(e){d=mb(eb(b),"A",null,b)}return pa(d,function(e){e=id(e);e=e.replace(/^[\s]+|[\s]+$/g,"");return c&&-1!=e.indexOf(a)||e==a})};X.s=function(a,b){return X.N(a,b,!1)};X.j=function(a,b){return X.K(a,b,!1)};rd.s=function(a,b){return X.N(a,b,!0)};
|
|
114
|
+
rd.j=function(a,b){return X.K(a,b,!0)};var Y={v:function(a,b){return function(c){var d=Y.m(a);d=V(d);c=V(c);return b.call(null,d,c)}},R:function(a){return Y.v(a,function(b,c){return c.b+c.height<=b.b})},S:function(a){return Y.v(a,function(b,c){return c.b>=b.b+b.height})},V:function(a){return Y.v(a,function(b,c){return c.a+c.width<=b.a})},aa:function(a){return Y.v(a,function(b,c){return c.a>=b.a+b.width})},ca:function(a){return Y.v(a,function(b,c){return c.a<b.a+b.width&&c.a+c.width>b.a&&c.b+c.height<=b.b})},da:function(a){return Y.v(a,
|
|
115
|
+
function(b,c){return c.a<b.a+b.width&&c.a+c.width>b.a&&c.b>=b.b+b.height})},ea:function(a){return Y.v(a,function(b,c){return c.b<b.b+b.height&&c.b+c.height>b.b&&c.a+c.width<=b.a})},fa:function(a){return Y.v(a,function(b,c){return c.b<b.b+b.height&&c.b+c.height>b.b&&c.a>=b.a+b.width})},W:function(a,b){var c;b?c=b:"number"==typeof a.distance&&(c=a.distance);c||(c=50);return function(d){var e=Y.m(a);if(e===d)return!1;e=V(e);d=V(d);e=new T(e.a-c,e.b-c,e.width+2*c,e.height+2*c);return e.a<=d.a+d.width&&
|
|
116
|
+
d.a<=e.a+e.width&&e.b<=d.b+d.height&&d.b<=e.b+e.height}},m:function(a){if(ha(a)&&1==a.nodeType)return a;if(ea(a))return Y.m(a.call(null));if(ha(a)){var b;a:{if(b=sd(a)){var c=td[b];if(c&&ea(c.s)){b=c.s(a[b],Bc.document);break a}}throw new P(61,"Unsupported locator strategy: "+b);}if(!b)throw new P(7,"No element has been found by "+JSON.stringify(a));return b}throw new P(61,"Selector is of wrong type: "+JSON.stringify(a));}};
|
|
117
|
+
Y.P={above:Y.R,below:Y.S,left:Y.V,near:Y.W,right:Y.aa,straightAbove:Y.ca,straightBelow:Y.da,straightLeft:Y.ea,straightRight:Y.fa};Y.O={above:Y.m,below:Y.m,left:Y.m,near:Y.m,right:Y.m,straightAbove:Y.m,straightBelow:Y.m,straightLeft:Y.m,straightRight:Y.m};
|
|
118
|
+
Y.U=function(a,b){var c=[];l(a,function(e){e&&ta(b,function(f){var g=f.kind,h=Y.P[g];if(!h)throw new P(61,"Cannot find filter suitable for "+g);return h.apply(null,f.args)(e)},null)&&c.push(e)},null);a=b[b.length-1];var d=Y.O[a?a.kind:"unknown"];return d?(a=d.apply(null,a.args))?Y.ba(a,c):c:c};
|
|
119
|
+
Y.ba=function(a,b){function c(f){f=V(f);return Math.sqrt(Math.pow(d-(f.a+Math.max(1,f.width)/2),2)+Math.pow(e-(f.b+Math.max(1,f.height)/2),2))}a=V(a);var d=a.a+Math.max(1,a.width)/2,e=a.b+Math.max(1,a.height)/2;xa(b,function(f,g){return c(f)-c(g)});return b};Y.s=function(a,b){a=Y.j(a,b);return 0==a.length?null:a[0]};
|
|
120
|
+
Y.j=function(a,b){if(!a.hasOwnProperty("root")||!a.hasOwnProperty("filters"))throw new P(61,"Locator not suitable for relative locators: "+JSON.stringify(a));var c=a.filters,d=da(c);if("array"!=d&&("object"!=d||"number"!=typeof c.length))throw new P(61,"Targets should be an array: "+JSON.stringify(a));var e;S(a.root)?e=[a.root]:e=ud(a.root,b);return 0==e.length?[]:Y.U(e,a.filters)};var vd={s:function(a,b){if(""===a)throw new P(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},j:function(a,b){if(""===a)throw new P(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var Z={};Z.I=function(){var a={ha:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
|
|
121
|
+
Z.u=function(a,b,c){var d=A(a);if(!d.documentElement)return null;(t||Hc)&&Ac(d?d.parentWindow||d.defaultView:window);try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):Z.I;if(t&&!Ua(7))return d.evaluate.call(d,b,a,e,c,null);if(!t||9<=Number(w)){for(var f={},g=d.getElementsByTagName("*"),h=0;h<g.length;++h){var p=g[h],u=p.namespaceURI;if(u&&!f[u]){var q=p.lookupPrefix(u);if(!q){var G=u.match(".*/(\\w+)/?$");q=G?G[1]:"xhtml"}f[u]=q}}var R={},fa;for(fa in f)R[f[fa]]=fa;e=function(n){return R[n]||
|
|
122
|
+
null}}try{return d.evaluate(b,a,e,c,null)}catch(n){if("TypeError"===n.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):Z.I,d.evaluate(b,a,e,c,null);throw n;}}catch(n){if(!Na||"NS_ERROR_ILLEGAL_VALUE"!=n.name)throw new P(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+n);}};Z.J=function(a,b){if(!a||1!=a.nodeType)throw new P(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
|
|
123
|
+
Z.s=function(a,b){var c=function(){var d=Z.u(b,a,9);return d?d.singleNodeValue||null:b.selectSingleNode?(d=A(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||Z.J(c,a);return c};
|
|
124
|
+
Z.j=function(a,b){var c=function(){var d=Z.u(b,a,7);if(d){for(var e=d.snapshotLength,f=[],g=0;g<e;++g)f.push(d.snapshotItem(g));return f}return b.selectNodes?(d=A(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();l(c,function(d){Z.J(d,a)});return c};var td={className:Dc,"class name":Dc,css:Nc,"css selector":Nc,relative:Y,id:qd,linkText:X,"link text":X,name:{s:function(a,b){b=mb(eb(b),"*",null,b);return ua(b,function(c){return Uc(c,"name")==a})},j:function(a,b){b=mb(eb(b),"*",null,b);return pa(b,function(c){return Uc(c,"name")==a})}},partialLinkText:rd,"partial link text":rd,tagName:vd,"tag name":vd,xpath:Z};function sd(a){for(var b in a)if(a.hasOwnProperty(b))return b;return null}
|
|
123
125
|
function ud(a,b){var c=sd(a);if(c){var d=td[c];if(d&&ea(d.j))return d.j(a[c],b||Bc.document)}throw new P(61,"Unsupported locator strategy: "+c);};ca("_",ud);; return this._.apply(null,arguments);}).apply({navigator:typeof window!='undefined'?window.navigator:null,document:typeof window!='undefined'?window.document:null}, arguments);};
|
package/lib/by.js
CHANGED
|
@@ -261,7 +261,7 @@ class By {
|
|
|
261
261
|
*
|
|
262
262
|
* Note: this method will likely be removed in the future please use
|
|
263
263
|
* `locateWith`.
|
|
264
|
-
* @param {By} The value returned from calling By.tagName()
|
|
264
|
+
* @param {By} tagName The value returned from calling By.tagName()
|
|
265
265
|
* @returns
|
|
266
266
|
*/
|
|
267
267
|
function withTagName(tagName) {
|
|
@@ -270,7 +270,7 @@ function withTagName(tagName) {
|
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
272
|
* Start searching for relative objects using search criteria with By.
|
|
273
|
-
* @param {string} A By map that shows how to find the initial element
|
|
273
|
+
* @param {string} by A By map that shows how to find the initial element
|
|
274
274
|
* @returns {RelativeBy}
|
|
275
275
|
*/
|
|
276
276
|
function locateWith(by) {
|
|
@@ -354,6 +354,58 @@ class RelativeBy {
|
|
|
354
354
|
return this
|
|
355
355
|
}
|
|
356
356
|
|
|
357
|
+
/**
|
|
358
|
+
* Look for elements above the root element passed in
|
|
359
|
+
* @param {string|WebElement} locatorOrElement
|
|
360
|
+
* @return {!RelativeBy} Return this object
|
|
361
|
+
*/
|
|
362
|
+
straightAbove(locatorOrElement) {
|
|
363
|
+
this.filters.push({
|
|
364
|
+
kind: 'straightAbove',
|
|
365
|
+
args: [getLocator(locatorOrElement)],
|
|
366
|
+
})
|
|
367
|
+
return this
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Look for elements below the root element passed in
|
|
372
|
+
* @param {string|WebElement} locatorOrElement
|
|
373
|
+
* @return {!RelativeBy} Return this object
|
|
374
|
+
*/
|
|
375
|
+
straightBelow(locatorOrElement) {
|
|
376
|
+
this.filters.push({
|
|
377
|
+
kind: 'straightBelow',
|
|
378
|
+
args: [getLocator(locatorOrElement)],
|
|
379
|
+
})
|
|
380
|
+
return this
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Look for elements left the root element passed in
|
|
385
|
+
* @param {string|WebElement} locatorOrElement
|
|
386
|
+
* @return {!RelativeBy} Return this object
|
|
387
|
+
*/
|
|
388
|
+
straightToLeftOf(locatorOrElement) {
|
|
389
|
+
this.filters.push({
|
|
390
|
+
kind: 'straightLeft',
|
|
391
|
+
args: [getLocator(locatorOrElement)],
|
|
392
|
+
})
|
|
393
|
+
return this
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Look for elements right the root element passed in
|
|
398
|
+
* @param {string|WebElement} locatorOrElement
|
|
399
|
+
* @return {!RelativeBy} Return this object
|
|
400
|
+
*/
|
|
401
|
+
straightToRightOf(locatorOrElement) {
|
|
402
|
+
this.filters.push({
|
|
403
|
+
kind: 'straightRight',
|
|
404
|
+
args: [getLocator(locatorOrElement)],
|
|
405
|
+
})
|
|
406
|
+
return this
|
|
407
|
+
}
|
|
408
|
+
|
|
357
409
|
/**
|
|
358
410
|
* Look for elements near the root element passed in
|
|
359
411
|
* @param {string|WebElement} locatorOrElement
|
package/lib/command.js
CHANGED
|
@@ -185,6 +185,17 @@ const Name = {
|
|
|
185
185
|
GET_DOWNLOADABLE_FILES: 'getDownloadableFiles',
|
|
186
186
|
DOWNLOAD_FILE: 'downloadFile',
|
|
187
187
|
DELETE_DOWNLOADABLE_FILES: 'deleteDownloadableFiles',
|
|
188
|
+
|
|
189
|
+
// Federated Credential Management API
|
|
190
|
+
// https://www.w3.org/TR/fedcm/#automation
|
|
191
|
+
CANCEL_DIALOG: 'cancelDialog',
|
|
192
|
+
SELECT_ACCOUNT: 'selectAccount',
|
|
193
|
+
GET_ACCOUNTS: 'getAccounts',
|
|
194
|
+
GET_FEDCM_TITLE: 'getFedCmTitle',
|
|
195
|
+
GET_FEDCM_DIALOG_TYPE: 'getFedCmDialogType',
|
|
196
|
+
SET_DELAY_ENABLED: 'setDelayEnabled',
|
|
197
|
+
RESET_COOLDOWN: 'resetCooldown',
|
|
198
|
+
CLICK_DIALOG_BUTTON: 'clickdialogbutton',
|
|
188
199
|
}
|
|
189
200
|
|
|
190
201
|
/**
|
|
@@ -0,0 +1,78 @@
|
|
|
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
|
+
|
|
18
|
+
class Account {
|
|
19
|
+
constructor(
|
|
20
|
+
accountId,
|
|
21
|
+
email,
|
|
22
|
+
name,
|
|
23
|
+
givenName,
|
|
24
|
+
pictureUrl,
|
|
25
|
+
idpConfigUrl,
|
|
26
|
+
loginState,
|
|
27
|
+
termsOfServiceUrl,
|
|
28
|
+
privacyPolicyUrl,
|
|
29
|
+
) {
|
|
30
|
+
this._accountId = accountId
|
|
31
|
+
this._email = email
|
|
32
|
+
this._name = name
|
|
33
|
+
this._givenName = givenName
|
|
34
|
+
this._pictureUrl = pictureUrl
|
|
35
|
+
this._idpConfigUrl = idpConfigUrl
|
|
36
|
+
this._loginState = loginState
|
|
37
|
+
this._termsOfServiceUrl = termsOfServiceUrl
|
|
38
|
+
this._privacyPolicyUrl = privacyPolicyUrl
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
get accountId() {
|
|
42
|
+
return this._accountId
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
get email() {
|
|
46
|
+
return this._email
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
get name() {
|
|
50
|
+
return this._name
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get givenName() {
|
|
54
|
+
return this._givenName
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
get pictureUrl() {
|
|
58
|
+
return this._pictureUrl
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
get idpConfigUrl() {
|
|
62
|
+
return this._idpConfigUrl
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
get loginState() {
|
|
66
|
+
return this._loginState
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
get termsOfServiceUrl() {
|
|
70
|
+
return this._termsOfServiceUrl
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
get privacyPolicyUrl() {
|
|
74
|
+
return this._privacyPolicyUrl
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
module.exports = Account
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
|
|
18
|
+
const command = require('../command')
|
|
19
|
+
const Account = require('./account')
|
|
20
|
+
|
|
21
|
+
class Dialog {
|
|
22
|
+
constructor(driver) {
|
|
23
|
+
this._driver = driver
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async title() {
|
|
27
|
+
const result = await this._driver.execute(new command.Command(command.Name.GET_FEDCM_TITLE))
|
|
28
|
+
|
|
29
|
+
return result.title
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
subtitle() {
|
|
33
|
+
return this._driver.execute(new command.Command(command.Name.GET_FEDCM_TITLE))
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type() {
|
|
37
|
+
return this._driver.execute(new command.Command(command.Name.GET_FEDCM_DIALOG_TYPE))
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
async accounts() {
|
|
41
|
+
const result = await this._driver.execute(new command.Command(command.Name.GET_ACCOUNTS))
|
|
42
|
+
|
|
43
|
+
const accountArray = []
|
|
44
|
+
|
|
45
|
+
result.forEach((account) => {
|
|
46
|
+
const acc = new Account(
|
|
47
|
+
account.accountId,
|
|
48
|
+
account.email,
|
|
49
|
+
account.name,
|
|
50
|
+
account.givenName,
|
|
51
|
+
account.pictureUrl,
|
|
52
|
+
account.idpConfigUrl,
|
|
53
|
+
account.loginState,
|
|
54
|
+
account.termsOfServiceUrl,
|
|
55
|
+
account.privacyPolicyUrl,
|
|
56
|
+
)
|
|
57
|
+
accountArray.push(acc)
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
return accountArray
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
selectAccount(index) {
|
|
64
|
+
return this._driver.execute(new command.Command(command.Name.SELECT_ACCOUNT).setParameter('accountIndex', index))
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
accept() {
|
|
68
|
+
return this._driver.execute(new command.Command(command.Name.CLICK_DIALOG_BUTTON))
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
dismiss() {
|
|
72
|
+
return this._driver.execute(new command.Command(command.Name.CANCEL_DIALOG))
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
module.exports = Dialog
|
package/lib/http.js
CHANGED
|
@@ -320,6 +320,16 @@ const W3C_COMMAND_MAP = new Map([
|
|
|
320
320
|
[cmd.Name.GET_DOWNLOADABLE_FILES, get('/session/:sessionId/se/files')],
|
|
321
321
|
[cmd.Name.DOWNLOAD_FILE, post(`/session/:sessionId/se/files`)],
|
|
322
322
|
[cmd.Name.DELETE_DOWNLOADABLE_FILES, del(`/session/:sessionId/se/files`)],
|
|
323
|
+
|
|
324
|
+
// Federated Credential Management Command
|
|
325
|
+
[cmd.Name.CANCEL_DIALOG, post(`/session/:sessionId/fedcm/canceldialog`)],
|
|
326
|
+
[cmd.Name.SELECT_ACCOUNT, post(`/session/:sessionId/fedcm/selectaccount`)],
|
|
327
|
+
[cmd.Name.GET_FEDCM_TITLE, get(`/session/:sessionId/fedcm/gettitle`)],
|
|
328
|
+
[cmd.Name.GET_FEDCM_DIALOG_TYPE, get('/session/:sessionId/fedcm/getdialogtype')],
|
|
329
|
+
[cmd.Name.SET_DELAY_ENABLED, post(`/session/:sessionId/fedcm/setdelayenabled`)],
|
|
330
|
+
[cmd.Name.RESET_COOLDOWN, post(`/session/:sessionId/fedcm/resetcooldown`)],
|
|
331
|
+
[cmd.Name.CLICK_DIALOG_BUTTON, post(`/session/:sessionId/fedcm/clickdialogbutton`)],
|
|
332
|
+
[cmd.Name.GET_ACCOUNTS, get(`/session/:sessionId/fedcm/accountlist`)],
|
|
323
333
|
])
|
|
324
334
|
|
|
325
335
|
/**
|
package/lib/network.js
CHANGED
|
@@ -20,9 +20,10 @@ const { InterceptPhase } = require('../bidi/interceptPhase')
|
|
|
20
20
|
const { AddInterceptParameters } = require('../bidi/addInterceptParameters')
|
|
21
21
|
|
|
22
22
|
class Network {
|
|
23
|
+
#callbackId = 0
|
|
23
24
|
#driver
|
|
24
25
|
#network
|
|
25
|
-
#
|
|
26
|
+
#authHandlers = new Map()
|
|
26
27
|
|
|
27
28
|
constructor(driver) {
|
|
28
29
|
this.#driver = driver
|
|
@@ -39,39 +40,51 @@ class Network {
|
|
|
39
40
|
return
|
|
40
41
|
}
|
|
41
42
|
this.#network = await network(this.#driver)
|
|
42
|
-
}
|
|
43
43
|
|
|
44
|
-
|
|
45
|
-
await this.#init()
|
|
44
|
+
await this.#network.addIntercept(new AddInterceptParameters(InterceptPhase.AUTH_REQUIRED))
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
await this.#network.authRequired(async (event) => {
|
|
47
|
+
const requestId = event.request.request
|
|
48
|
+
const uri = event.request.url
|
|
49
|
+
const credentials = this.getAuthCredentials(uri)
|
|
50
|
+
if (credentials !== null) {
|
|
51
|
+
await this.#network.continueWithAuth(requestId, credentials.username, credentials.password)
|
|
52
|
+
return
|
|
53
|
+
}
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
await this.#network.continueWithAuth(event.request.request, username, password)
|
|
55
|
+
await this.#network.continueWithAuthNoCredentials(requestId)
|
|
51
56
|
})
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
getAuthCredentials(uri) {
|
|
60
|
+
for (let [, value] of this.#authHandlers) {
|
|
61
|
+
if (uri.match(value.uri)) {
|
|
62
|
+
return value
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return null
|
|
66
|
+
}
|
|
67
|
+
async addAuthenticationHandler(username, password, uri = '//') {
|
|
68
|
+
await this.#init()
|
|
52
69
|
|
|
53
|
-
this.#
|
|
70
|
+
const id = this.#callbackId++
|
|
71
|
+
|
|
72
|
+
this.#authHandlers.set(id, { username, password, uri })
|
|
54
73
|
return id
|
|
55
74
|
}
|
|
56
75
|
|
|
57
76
|
async removeAuthenticationHandler(id) {
|
|
58
77
|
await this.#init()
|
|
59
78
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
this.#callBackInterceptIdMap.delete(id)
|
|
79
|
+
if (this.#authHandlers.has(id)) {
|
|
80
|
+
this.#authHandlers.delete(id)
|
|
81
|
+
} else {
|
|
82
|
+
throw Error(`Callback with id ${id} not found`)
|
|
83
|
+
}
|
|
66
84
|
}
|
|
67
85
|
|
|
68
86
|
async clearAuthenticationHandlers() {
|
|
69
|
-
|
|
70
|
-
await this.#network.removeIntercept(value)
|
|
71
|
-
await this.#network.removeCallback(key)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
this.#callBackInterceptIdMap.clear()
|
|
87
|
+
this.#authHandlers.clear()
|
|
75
88
|
}
|
|
76
89
|
}
|
|
77
90
|
|
package/lib/webdriver.js
CHANGED
|
@@ -45,6 +45,7 @@ const { PinnedScript } = require('./pinnedScript')
|
|
|
45
45
|
const JSZip = require('jszip')
|
|
46
46
|
const Script = require('./script')
|
|
47
47
|
const Network = require('./network')
|
|
48
|
+
const Dialog = require('./fedcm/dialog')
|
|
48
49
|
|
|
49
50
|
// Capability names that are defined in the W3C spec.
|
|
50
51
|
const W3C_CAPABILITY_NAMES = new Set([
|
|
@@ -1106,6 +1107,18 @@ class WebDriver {
|
|
|
1106
1107
|
return this.execute(new command.Command(command.Name.SCREENSHOT))
|
|
1107
1108
|
}
|
|
1108
1109
|
|
|
1110
|
+
setDelayEnabled(enabled) {
|
|
1111
|
+
return this.execute(new command.Command(command.Name.SET_DELAY_ENABLED).setParameter('enabled', enabled))
|
|
1112
|
+
}
|
|
1113
|
+
|
|
1114
|
+
resetCooldown() {
|
|
1115
|
+
return this.execute(new command.Command(command.Name.RESET_COOLDOWN))
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
getFederalCredentialManagementDialog() {
|
|
1119
|
+
return new Dialog(this)
|
|
1120
|
+
}
|
|
1121
|
+
|
|
1109
1122
|
/** @override */
|
|
1110
1123
|
manage() {
|
|
1111
1124
|
return new Options(this)
|
|
@@ -1230,6 +1243,12 @@ class WebDriver {
|
|
|
1230
1243
|
|
|
1231
1244
|
const caps = await this.getCapabilities()
|
|
1232
1245
|
|
|
1246
|
+
if (caps['map_'].get('browserName') === 'firefox') {
|
|
1247
|
+
console.warn(
|
|
1248
|
+
'CDP support for Firefox is deprecated and will be removed in future versions. Please switch to WebDriver BiDi.',
|
|
1249
|
+
)
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1233
1252
|
if (process.env.SELENIUM_REMOTE_URL) {
|
|
1234
1253
|
const host = new URL(process.env.SELENIUM_REMOTE_URL).host
|
|
1235
1254
|
const sessionId = await this.getSession().then((session) => session.getId())
|
|
@@ -1918,6 +1937,11 @@ class Options {
|
|
|
1918
1937
|
* when the cookie has been deleted.
|
|
1919
1938
|
*/
|
|
1920
1939
|
deleteCookie(name) {
|
|
1940
|
+
// Validate the cookie name is non-empty and properly trimmed.
|
|
1941
|
+
if (!name?.trim()) {
|
|
1942
|
+
throw new error.InvalidArgumentError('Cookie name cannot be empty')
|
|
1943
|
+
}
|
|
1944
|
+
|
|
1921
1945
|
return this.driver_.execute(new command.Command(command.Name.DELETE_COOKIE).setParameter('name', name))
|
|
1922
1946
|
}
|
|
1923
1947
|
|
|
@@ -1938,11 +1962,17 @@ class Options {
|
|
|
1938
1962
|
* WebDriver wire protocol.
|
|
1939
1963
|
*
|
|
1940
1964
|
* @param {string} name The name of the cookie to retrieve.
|
|
1965
|
+
* @throws {InvalidArgumentError} - If the cookie name is empty or invalid.
|
|
1941
1966
|
* @return {!Promise<?Options.Cookie>} A promise that will be resolved
|
|
1942
1967
|
* with the named cookie
|
|
1943
1968
|
* @throws {error.NoSuchCookieError} if there is no such cookie.
|
|
1944
1969
|
*/
|
|
1945
1970
|
async getCookie(name) {
|
|
1971
|
+
// Validate the cookie name is non-empty and properly trimmed.
|
|
1972
|
+
if (!name?.trim()) {
|
|
1973
|
+
throw new error.InvalidArgumentError('Cookie name cannot be empty')
|
|
1974
|
+
}
|
|
1975
|
+
|
|
1946
1976
|
try {
|
|
1947
1977
|
const cookie = await this.driver_.execute(new command.Command(command.Name.GET_COOKIE).setParameter('name', name))
|
|
1948
1978
|
return cookie
|
|
@@ -1950,13 +1980,6 @@ class Options {
|
|
|
1950
1980
|
if (!(err instanceof error.UnknownCommandError) && !(err instanceof error.UnsupportedOperationError)) {
|
|
1951
1981
|
throw err
|
|
1952
1982
|
}
|
|
1953
|
-
|
|
1954
|
-
const cookies = await this.getCookies()
|
|
1955
|
-
for (let cookie of cookies) {
|
|
1956
|
-
if (cookie && cookie['name'] === name) {
|
|
1957
|
-
return cookie
|
|
1958
|
-
}
|
|
1959
|
-
}
|
|
1960
1983
|
return null
|
|
1961
1984
|
}
|
|
1962
1985
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "selenium-webdriver",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.28.0",
|
|
4
4
|
"description": "The official WebDriver JavaScript bindings from the Selenium project",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"url": "https://github.com/SeleniumHQ/selenium.git"
|
|
21
21
|
},
|
|
22
22
|
"engines": {
|
|
23
|
-
"node": ">=
|
|
23
|
+
"node": ">= 22.13.0"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@bazel/runfiles": "^6.3.1",
|
|
@@ -29,25 +29,25 @@
|
|
|
29
29
|
"ws": "^8.18.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@eslint/js": "^9.
|
|
32
|
+
"@eslint/js": "^9.18.0",
|
|
33
33
|
"clean-jsdoc-theme": "^4.3.0",
|
|
34
|
-
"eslint": "^9.
|
|
35
|
-
"eslint-config-prettier": "^
|
|
34
|
+
"eslint": "^9.18.0",
|
|
35
|
+
"eslint-config-prettier": "^10.0.1",
|
|
36
36
|
"eslint-plugin-mocha": "^10.5.0",
|
|
37
|
-
"eslint-plugin-n": "^17.
|
|
37
|
+
"eslint-plugin-n": "^17.15.1",
|
|
38
38
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
39
39
|
"eslint-plugin-prettier": "^5.2.1",
|
|
40
|
-
"express": "^4.21.
|
|
41
|
-
"globals": "^15.
|
|
40
|
+
"express": "^4.21.2",
|
|
41
|
+
"globals": "^15.14.0",
|
|
42
42
|
"has-flag": "^5.0.1",
|
|
43
43
|
"jsdoc": "^4.0.4",
|
|
44
|
-
"mocha": "^
|
|
44
|
+
"mocha": "^11.0.1",
|
|
45
45
|
"mocha-junit-reporter": "^2.2.1",
|
|
46
46
|
"multer": "1.4.5-lts.1",
|
|
47
|
-
"prettier": "^3.
|
|
47
|
+
"prettier": "^3.4.2",
|
|
48
48
|
"serve-index": "^1.9.1",
|
|
49
49
|
"sinon": "^19.0.2",
|
|
50
|
-
"supports-color": "^
|
|
50
|
+
"supports-color": "^10.0.0"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"lint": "eslint .",
|
|
@@ -61,5 +61,15 @@
|
|
|
61
61
|
},
|
|
62
62
|
"publishConfig": {
|
|
63
63
|
"registry": "https://registry.npmjs.org/"
|
|
64
|
-
}
|
|
64
|
+
},
|
|
65
|
+
"funding": [
|
|
66
|
+
{
|
|
67
|
+
"type": "github",
|
|
68
|
+
"url": "https://github.com/sponsors/SeleniumHQ"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "opencollective",
|
|
72
|
+
"url": "https://opencollective.com/selenium"
|
|
73
|
+
}
|
|
74
|
+
]
|
|
65
75
|
}
|
package/safari.js
CHANGED
|
@@ -78,6 +78,19 @@ class Options extends Capabilities {
|
|
|
78
78
|
this.options_[TECHNOLOGY_PREVIEW_OPTIONS_KEY] = !!useTechnologyPreview
|
|
79
79
|
return this
|
|
80
80
|
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Enables diagnostic logging for Safari.
|
|
84
|
+
*
|
|
85
|
+
* This method sets the `safari:diagnose` option to `true` in the current configuration.
|
|
86
|
+
* It is used to enable additional logging or diagnostic features specific to Safari.
|
|
87
|
+
*
|
|
88
|
+
* @returns {Options} Returns the current instance
|
|
89
|
+
*/
|
|
90
|
+
enableLogging() {
|
|
91
|
+
this.set('safari:diagnose', true)
|
|
92
|
+
return this
|
|
93
|
+
}
|
|
81
94
|
}
|
|
82
95
|
|
|
83
96
|
/**
|