selenium-webdriver 4.37.0 → 4.39.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.
- checksums.yaml +4 -4
- data/CHANGES +11 -0
- data/Gemfile +0 -4
- data/bin/linux/selenium-manager +0 -0
- data/bin/macos/selenium-manager +0 -0
- data/bin/windows/selenium-manager.exe +0 -0
- data/lib/selenium/webdriver/atoms/findElements.js +8 -8
- data/lib/selenium/webdriver/atoms/isDisplayed.js +12 -12
- data/lib/selenium/webdriver/bidi/network/cookies.rb +5 -8
- data/lib/selenium/webdriver/bidi/network/intercepted_request.rb +16 -4
- data/lib/selenium/webdriver/bidi/network/intercepted_response.rb +20 -6
- data/lib/selenium/webdriver/bidi/network.rb +12 -9
- data/lib/selenium/webdriver/bidi.rb +0 -1
- data/lib/selenium/webdriver/common/error.rb +7 -0
- data/lib/selenium/webdriver/common/platform.rb +1 -3
- data/lib/selenium/webdriver/devtools.rb +1 -1
- data/lib/selenium/webdriver/version.rb +1 -1
- metadata +2 -8
- data/lib/selenium/webdriver/bidi/log/base_log_entry.rb +0 -35
- data/lib/selenium/webdriver/bidi/log/console_log_entry.rb +0 -35
- data/lib/selenium/webdriver/bidi/log/filter_by.rb +0 -40
- data/lib/selenium/webdriver/bidi/log/generic_log_entry.rb +0 -33
- data/lib/selenium/webdriver/bidi/log/javascript_log_entry.rb +0 -33
- data/lib/selenium/webdriver/bidi/log_inspector.rb +0 -147
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7b1fdbaa0854a443d9e43ba3ffbfbddb8ffe663f82040b26803f230ab7fc5642
|
|
4
|
+
data.tar.gz: b2b038ed6a4e4c1b52bdec1f06b302db6b475a7fdeda15e7bcea8899e89f33d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: efc466f3509b7526aeb783c802214c059440dd0fcdd68a391a13cac74ff119c3aa537ecacb00d2fd78179dfb996a117946dbd3d0ff1855e0e1a940a9d2781163
|
|
7
|
+
data.tar.gz: f02401c192cdcb648e4c1958b17f54beba1d1b7f3c9cf0a262f5d9b799e0932c721d00d8b961c0367c5fc4d3aad01497317f470c480567441081d954d7f1d087
|
data/CHANGES
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
4.39.0 (2025-12-06)
|
|
2
|
+
=========================
|
|
3
|
+
* Add CDP for Chrome 143 and remove 140
|
|
4
|
+
|
|
5
|
+
4.38.0 (2025-10-24)
|
|
6
|
+
=========================
|
|
7
|
+
* Add CDP for Chrome 142 and remove 139
|
|
8
|
+
* Fix BiDi Network issue by removing nil values on network requests (#16442)
|
|
9
|
+
* Remove cruft from old CI environment (#16473)
|
|
10
|
+
* [bidi] remove deprecated classes for log inspector (#16474)
|
|
11
|
+
|
|
1
12
|
4.37.0 (2025-10-16)
|
|
2
13
|
=========================
|
|
3
14
|
* Add CDP for Chrome 141 and remove 138
|
data/Gemfile
CHANGED
|
@@ -10,7 +10,3 @@ gem 'activesupport', '~> 7.0', require: false, platforms: %i[mri mingw x64_mingw
|
|
|
10
10
|
gem 'curb', '~> 1.0.5', require: false, platforms: %i[mri mingw x64_mingw]
|
|
11
11
|
gem 'debug', '~> 1.7', require: false, platforms: %i[mri mingw x64_mingw]
|
|
12
12
|
gem 'steep', '~> 1.5.0', require: false, platforms: %i[mri mingw x64_mingw]
|
|
13
|
-
|
|
14
|
-
# Prism staring with 1.5 fails to build with the following error:
|
|
15
|
-
# src/prism.c:8651:62: error: conversion to ‘unsigned int’ from ‘int’ may change the sign of the result [-Werror=sign-conversion]
|
|
16
|
-
gem 'prism', ['~> 1.0', '< 1.5']
|
data/bin/linux/selenium-manager
CHANGED
|
Binary file
|
data/bin/macos/selenium-manager
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function(){return (function(){var h=this||self;
|
|
2
2
|
function aa(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";else if("function"==
|
|
3
|
-
b&&"undefined"==typeof a.call)return"object";return b}function l(a){return"function"==aa(a)}function n(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};var ca=window;function q(a,b){this.code=a;this.a=r[a]||
|
|
4
|
-
r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=
|
|
3
|
+
b&&"undefined"==typeof a.call)return"object";return b}function l(a){return"function"==aa(a)}function n(a){var b=typeof a;return"object"==b&&null!=a||"function"==b}function ba(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};var ca=window;function q(a,b){this.code=a;this.a=r[a]||t;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||""}ba(q,Error);var t="unknown error",r={15:"element not selectable",11:"element not visible"};r[31]=t;r[30]=t;r[24]="invalid cookie domain";r[29]="invalid element coordinates";r[12]="invalid element state";
|
|
4
|
+
r[32]="invalid selector";r[51]="invalid selector";r[52]="invalid selector";r[17]="javascript error";r[405]="unsupported operation";r[34]="move target out of bounds";r[27]="no such alert";r[7]="no such element";r[8]="no such frame";r[23]="no such window";r[28]="script timeout";r[33]="session not created";r[10]="stale element reference";r[21]="timeout";r[25]="unable to set cookie";r[26]="unexpected alert open";r[13]=t;r[9]="unknown command";var da;var ea=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},w=Array.prototype.forEach?function(a,b,c){Array.prototype.forEach.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++)f in e&&b.call(c,e[f],f,a)},fa=Array.prototype.filter?function(a,b){return Array.prototype.filter.call(a,
|
|
5
5
|
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 k=f[g];b.call(void 0,k,g,a)&&(d[e++]=k)}return d},ha=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},ia=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,
|
|
6
6
|
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},ja=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};
|
|
7
7
|
function ka(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 la(a,b){a.sort(b||ma)}function ma(a,b){return a>b?1:a<b?-1:0};function na(a){var b=a.length-1;return 0<=b&&a.indexOf(" ",b)==b}var x=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};
|
|
@@ -22,18 +22,18 @@ Q.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b)
|
|
|
22
22
|
function R(a,b){b=ua(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=Wa?"styleFloat":"cssFloat";a:{var c=b;var d=J(a);if(d.defaultView&&d.defaultView.getComputedStyle&&(d=d.defaultView.getComputedStyle(a,null))){c=d[c]||d.getPropertyValue(c)||"";break a}c=""}a=c||hb(a,b);if(null===a)a=null;else if(0<=ea(Ya,b)){b:{var e=a.match(ab);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(bb))if(b=
|
|
23
23
|
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=Xa[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(Za,"#$1$1$2$2$3$3")),!$a.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}
|
|
24
24
|
function hb(a,b){var c=a.currentStyle||a.style,d=c[b];void 0===d&&l(c.getPropertyValue)&&(d=c.getPropertyValue(b));return"inherit"!=d?void 0!==d?d:null:(a=gb(a))?hb(a,b):null}
|
|
25
|
-
function ib(a,b,c){function d(g){var k=S(g);
|
|
26
|
-
|
|
25
|
+
function ib(a,b,c){function d(g){var k=S(g);if(0<k.height&&0<k.width)return!0;if(P(g,"PATH")&&(0<k.height||0<k.width))return g=R(g,"stroke-width"),!!g&&0<parseInt(g,10);k=R(g,"visibility");return"collapse"!=k&&"hidden"!=k&&c(g)?"hidden"!=R(g,"overflow")&&ia(g.childNodes,function(z){return 3==z.nodeType||P(z)&&d(z)}):!1}function e(g){return jb(g)==T&&ja(g.childNodes,function(k){return!P(k)||e(k)||!d(k)})}if(!P(a))throw Error("Argument to isShown must be of type Element");if(P(a,"BODY"))return!0;if(P(a,
|
|
26
|
+
"OPTION")||P(a,"OPTGROUP"))return a=La(a,function(g){return P(g,"SELECT")}),!!a&&ib(a,!0,c);var f=kb(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&ib(f.image,b,c);if(P(a,"INPUT")&&"hidden"==a.type.toLowerCase()||P(a,"NOSCRIPT"))return!1;f=R(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=lb(a))&&d(a)?!e(a):!1}
|
|
27
27
|
function mb(a){function b(c){if(P(c)&&("none"==R(c,"display")||"hidden"==R(c,"content-visibility")))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(fb&&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&&P(d,"DETAILS")&&!d.open&&!P(c,"SUMMARY")?
|
|
28
28
|
!1:!!d&&b(d):!0}return ib(a,!1,b)}var T="hidden";
|
|
29
29
|
function jb(a){function b(m){function p(wa){if(wa==g)return!0;var Pa=R(wa,"display");return 0==Pa.lastIndexOf("inline",0)||"contents"==Pa||"absolute"==Qa&&"static"==R(wa,"position")?!1:!0}var Qa=R(m,"position");if("fixed"==Qa)return A=!0,m==g?null:g;for(m=gb(m);m&&!p(m);)m=gb(m);return m}function c(m){var p=m;if("visible"==z)if(m==g&&k)p=k;else if(m==k)return{x:"visible",y:"visible"};p={x:R(p,"overflow-x"),y:R(p,"overflow-y")};m==g&&(p.x="visible"==p.x?"auto":p.x,p.y="visible"==p.y?"auto":p.y);return p}
|
|
30
|
-
function d(m){if(m==g){var p=(new Ia(f)).a;m=p.scrollingElement?p.scrollingElement:Ba||"CSS1Compat"!=p.compatMode?p.body||p.documentElement:p.documentElement;p=p.parentWindow||p.defaultView;m=E&&Ha("10")&&p.pageYOffset!=m.scrollTop?new G(m.scrollLeft,m.scrollTop):new G(p.pageXOffset||m.scrollLeft,p.pageYOffset||m.scrollTop)}else m=new G(m.scrollLeft,m.scrollTop);return m}var e=nb(a),f=J(a),g=f.documentElement,k=f.body,z=R(g,"overflow"),A;for(a=b(a);a;a=b(a)){var
|
|
31
|
-
|
|
30
|
+
function d(m){if(m==g){var p=(new Ia(f)).a;m=p.scrollingElement?p.scrollingElement:Ba||"CSS1Compat"!=p.compatMode?p.body||p.documentElement:p.documentElement;p=p.parentWindow||p.defaultView;m=E&&Ha("10")&&p.pageYOffset!=m.scrollTop?new G(m.scrollLeft,m.scrollTop):new G(p.pageXOffset||m.scrollLeft,p.pageYOffset||m.scrollTop)}else m=new G(m.scrollLeft,m.scrollTop);return m}var e=nb(a),f=J(a),g=f.documentElement,k=f.body,z=R(g,"overflow"),A;for(a=b(a);a;a=b(a)){var u=c(a);if("visible"!=u.x||"visible"!=
|
|
31
|
+
u.y){var v=S(a);if(0==v.width||0==v.height)return T;var B=e.a<v.a,K=e.b<v.b;if(B&&"hidden"==u.x||K&&"hidden"==u.y)return T;if(B&&"visible"!=u.x||K&&"visible"!=u.y){B=d(a);K=e.b<v.b-B.y;if(e.a<v.a-B.x&&"visible"!=u.x||K&&"visible"!=u.x)return T;e=jb(a);return e==T?T:"scroll"}B=e.h>=v.a+v.width;v=e.j>=v.b+v.height;if(B&&"hidden"==u.x||v&&"hidden"==u.y)return T;if(B&&"visible"!=u.x||v&&"visible"!=u.y){if(A&&(u=d(a),e.h>=g.scrollWidth-u.x||e.a>=g.scrollHeight-u.y))return T;e=jb(a);return e==T?T:"scroll"}}}return"none"}
|
|
32
32
|
function S(a){var b=kb(a);if(b)return b.rect;if(P(a,"HTML"))return a=J(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new H(a.clientWidth,a.clientHeight),new Q(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(d){return new Q(0,0,0,0)}b=new Q(c.left,c.top,c.right-c.left,c.bottom-c.top);E&&a.ownerDocument.body&&(a=J(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop);
|
|
33
33
|
return b}function kb(a){var b=P(a,"MAP");if(!b&&!P(a,"AREA"))return null;var c=b?a:P(a.parentNode,"MAP")?a.parentNode:null,d=null,e=null;c&&c.name&&(d=N.g('*[usemap="#'+c.name+'"]',J(c)))&&(e=S(d),b||"default"==a.shape.toLowerCase()||(a=ob(a),b=Math.min(Math.max(a.a,0),e.width),c=Math.min(Math.max(a.b,0),e.height),e=new Q(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 Q(0,0,0,0)}}
|
|
34
34
|
function ob(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 Q(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new Q(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 Q(b,c,d-b,e-c)}return new Q(0,0,0,0)}function nb(a){a=S(a);return new eb(a.b,a.a+a.width,a.b+a.height,a.a)}
|
|
35
35
|
function pb(a){return a.replace(/^[^\S\xa0]+|[^\S\xa0]+$/g,"")}function qb(a){var b=[];fb?rb(a,b):sb(a,b);a=ha(b,pb);return pb(a.join("\n")).replace(/\xa0/g," ")}
|
|
36
|
-
function tb(a,b,c){if(P(a,"BR"))b.push("");else{var d=P(a,"TD"),e=R(a,"display"),f=!d&&!(0<=ea(ub,e)),g=void 0!==a.previousElementSibling?a.previousElementSibling:Ja(a.previousSibling);g=g?R(g,"display"):"";var k=R(a,"float")||R(a,"cssFloat")||R(a,"styleFloat");!f||"run-in"==g&&"none"==k||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var z=mb(a),A=null,
|
|
36
|
+
function tb(a,b,c){if(P(a,"BR"))b.push("");else{var d=P(a,"TD"),e=R(a,"display"),f=!d&&!(0<=ea(ub,e)),g=void 0!==a.previousElementSibling?a.previousElementSibling:Ja(a.previousSibling);g=g?R(g,"display"):"";var k=R(a,"float")||R(a,"cssFloat")||R(a,"styleFloat");!f||"run-in"==g&&"none"==k||/^[\s\xa0]*$/.test(b[b.length-1]||"")||b.push("");var z=mb(a),A=null,u=null;z&&(A=R(a,"white-space"),u=R(a,"text-transform"));w(a.childNodes,function(v){c(v,b,z,A,u)});a=b[b.length-1]||"";!d&&"table-cell"!=e||!a||
|
|
37
37
|
na(a)||(b[b.length-1]+=" ");f&&"run-in"!=e&&!/^[\s\xa0]*$/.test(a)&&b.push("")}}function sb(a,b){tb(a,b,function(c,d,e,f,g){3==c.nodeType&&e?vb(c,d,f,g):P(c)&&sb(c,d)})}var ub="inline inline-block inline-table none table-cell table-column table-column-group".split(" ");
|
|
38
38
|
function vb(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?(c=/(^|[^'_0-9A-Za-z\u00C0-\u02AF\u1E00-\u1EFF\u24B6-\u24E9\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF])([A-Za-z\u00C0-\u02AF\u1E00-\u1EFF\u24B6-\u24E9])/g,a=a.replace(c,function(e,f,g){return f+g.toUpperCase()}),c=/(^|[^'_0-9A-Za-z\u00C0-\u02AF\u1E00-\u1EFF\u24B6-\u24E9])([_*])([A-Za-z\u00C0-\u02AF\u1E00-\u1EFF\u24D0-\u24E9])/g,
|
|
39
39
|
a=a.replace(c,function(e,f,g,k){return f+g+k.toUpperCase()})):"uppercase"==d?a=a.toUpperCase():"lowercase"==d&&(a=a.toLowerCase());c=b.pop()||"";na(c)&&0==a.lastIndexOf(" ",0)&&(a=a.substr(1));b.push(c+a)}function lb(a){if(Wa){if("relative"==R(a,"position"))return 1;a=R(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return wb(a)}
|
|
@@ -48,7 +48,7 @@ V.B={above:V.C,below:V.D,left:V.H,near:V.I,right:V.J,straightAbove:V.L,straightB
|
|
|
48
48
|
V.G=function(a,b){var c=[];w(a,function(e){e&&ja(b,function(f){var g=f.kind,k=V.B[g];if(!k)throw new q(61,"Cannot find filter suitable for "+g);return k.apply(null,f.args)(e)},null)&&c.push(e)},null);a=b[b.length-1];var d=V.A[a?a.kind:"unknown"];return d?(a=d.apply(null,a.args))?V.K(a,c):c:c};
|
|
49
49
|
V.K=function(a,b){function c(f){f=S(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=S(a);var d=a.a+Math.max(1,a.width)/2,e=a.b+Math.max(1,a.height)/2;la(b,function(f,g){return c(f)-c(g)});return b};V.g=function(a,b){a=V.c(a,b);return 0==a.length?null:a[0]};
|
|
50
50
|
V.c=function(a,b){if(!a.hasOwnProperty("root")||!a.hasOwnProperty("filters"))throw new q(61,"Locator not suitable for relative locators: "+JSON.stringify(a));var c=a.filters,d=aa(c);if("array"!=d&&("object"!=d||"number"!=typeof c.length))throw new q(61,"Targets should be an array: "+JSON.stringify(a));var e;P(a.root)?e=[a.root]:e=Cb(a.root,b);return 0==e.length?[]:V.G(e,a.filters)};var Db={g:function(a,b){if(""===a)throw new q(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)[0]||null},c:function(a,b){if(""===a)throw new q(32,'Unable to locate an element with the tagName ""');return b.getElementsByTagName(a)}};var W={};W.m=function(){var a={P:"http://www.w3.org/2000/svg"};return function(b){return a[b]||null}}();
|
|
51
|
-
W.s=function(a,b,c){var d=J(a);if(!d.documentElement)return null;try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):W.m;if(E&&!Ha(7))return d.evaluate.call(d,b,a,e,c,null);if(!E||9<=Number(F)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var z=g[k],A=z.namespaceURI;if(A&&!f[A]){var
|
|
51
|
+
W.s=function(a,b,c){var d=J(a);if(!d.documentElement)return null;try{var e=d.createNSResolver?d.createNSResolver(d.documentElement):W.m;if(E&&!Ha(7))return d.evaluate.call(d,b,a,e,c,null);if(!E||9<=Number(F)){for(var f={},g=d.getElementsByTagName("*"),k=0;k<g.length;++k){var z=g[k],A=z.namespaceURI;if(A&&!f[A]){var u=z.lookupPrefix(A);if(!u){var v=A.match(".*/(\\w+)/?$");u=v?v[1]:"xhtml"}f[A]=u}}var B={},K;for(K in f)B[f[K]]=K;e=function(m){return B[m]||null}}try{return d.evaluate(b,a,e,c,null)}catch(m){if("TypeError"===
|
|
52
52
|
m.name)return e=d.createNSResolver?d.createNSResolver(d.documentElement):W.m,d.evaluate(b,a,e,c,null);throw m;}}catch(m){if(!Aa||"NS_ERROR_ILLEGAL_VALUE"!=m.name)throw new q(32,"Unable to locate an element with the xpath expression "+b+" because of the following error:\n"+m);}};W.o=function(a,b){if(!a||1!=a.nodeType)throw new q(32,'The result of the xpath expression "'+b+'" is: '+a+". It should be an element.");};
|
|
53
53
|
W.g=function(a,b){var c=function(){var d=W.s(b,a,9);return d?d.singleNodeValue||null:b.selectSingleNode?(d=J(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectSingleNode(a)):null}();null===c||W.o(c,a);return c};
|
|
54
54
|
W.c=function(a,b){var c=function(){var d=W.s(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=J(b),d.setProperty&&d.setProperty("SelectionLanguage","XPath"),b.selectNodes(a)):[]}();w(c,function(d){W.o(d,a)});return c};var Bb={className:Ma,"class name":Ma,css:N,"css selector":N,relative:V,id:yb,linkText:U,"link text":U,name:{g:function(a,b){b=L(I(b),"*",null,b);return ka(b,function(c){return O(c,"name")==a})},c:function(a,b){b=L(I(b),"*",null,b);return fa(b,function(c){return O(c,"name")==a})}},partialLinkText:zb,"partial link text":zb,tagName:Db,"tag name":Db,xpath:W};function Ab(a){for(var b in a)if(a.hasOwnProperty(b))return b;return null}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function(){return (function(){var
|
|
1
|
+
function(){return (function(){var h=this||self;
|
|
2
2
|
function aa(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";else if("function"==
|
|
3
3
|
b&&"undefined"==typeof a.call)return"object";return b}function ca(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};var da=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf.call(a,b,void 0)}:function(a,b){if("string"===typeof a)return"string"!==typeof b||1!=b.length?-1:a.indexOf(b,0);for(var c=0;c<a.length;c++)if(c in a&&a[c]===b)return c;return-1},ea=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,e="string"===typeof a?a.split(""):a,d=0;d<c;d++)if(d in e&&b.call(void 0,e[d],d,a))return!0;return!1},fa=Array.prototype.every?function(a,
|
|
4
4
|
b){return Array.prototype.every.call(a,b,void 0)}:function(a,b){for(var c=a.length,e="string"===typeof a?a.split(""):a,d=0;d<c;d++)if(d in e&&!b.call(void 0,e[d],d,a))return!1;return!0};var ha={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",
|
|
@@ -6,23 +6,23 @@ darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#55
|
|
|
6
6
|
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",
|
|
7
7
|
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",
|
|
8
8
|
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",
|
|
9
|
-
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 ia="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),ja=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,ka=/^#(?:[0-9a-f]{3}){1,2}$/i,la=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,ma=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function m(a,b){this.code=a;this.a=p[a]||
|
|
10
|
-
p[32]="invalid selector";p[51]="invalid selector";p[52]="invalid selector";p[17]="javascript error";p[405]="unsupported operation";p[34]="move target out of bounds";p[27]="no such alert";p[7]="no such element";p[8]="no such frame";p[23]="no such window";p[28]="script timeout";p[33]="session not created";p[10]="stale element reference";p[21]="timeout";p[25]="unable to set cookie";p[26]="unexpected alert open";p[13]=
|
|
11
|
-
function na(a,b){var c=0;a=u(String(a)).split(".");b=u(String(b)).split(".");for(var e=Math.max(a.length,b.length),d=0;0==c&&d<e;d++){var f=a[d]||"",
|
|
12
|
-
a:{var F="",G=function(){var a=w;if(ya)return/rv:([^\);]+)(\)|;)/.exec(a);if(xa)return/Edge\/([\d\.]+)/.exec(a);if(C)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(za)return/WebKit\/(\S+)/.exec(a);if(wa)return/(?:Version)[ \/]?(\S+)/.exec(a)}();G&&(F=G?G[1]:"");if(C){var H=Aa();if(null!=H&&H>parseFloat(F)){E=String(H);break a}}E=F}var va={};function Ba(a){return ua(a,function(){return 0<=na(E,a)})}var I;I=
|
|
9
|
+
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 ia="backgroundColor borderTopColor borderRightColor borderBottomColor borderLeftColor color outlineColor".split(" "),ja=/#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/,ka=/^#(?:[0-9a-f]{3}){1,2}$/i,la=/^(?:rgba)?\((\d{1,3}),\s?(\d{1,3}),\s?(\d{1,3}),\s?(0|1|0\.\d*)\)$/i,ma=/^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;function m(a,b){this.code=a;this.a=p[a]||q;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||""}ca(m,Error);var q="unknown error",p={15:"element not selectable",11:"element not visible"};p[31]=q;p[30]=q;p[24]="invalid cookie domain";p[29]="invalid element coordinates";p[12]="invalid element state";
|
|
10
|
+
p[32]="invalid selector";p[51]="invalid selector";p[52]="invalid selector";p[17]="javascript error";p[405]="unsupported operation";p[34]="move target out of bounds";p[27]="no such alert";p[7]="no such element";p[8]="no such frame";p[23]="no such window";p[28]="script timeout";p[33]="session not created";p[10]="stale element reference";p[21]="timeout";p[25]="unable to set cookie";p[26]="unexpected alert open";p[13]=q;p[9]="unknown command";var u=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};
|
|
11
|
+
function na(a,b){var c=0;a=u(String(a)).split(".");b=u(String(b)).split(".");for(var e=Math.max(a.length,b.length),d=0;0==c&&d<e;d++){var f=a[d]||"",g=b[d]||"";do{f=/(\d*)(\D*)(.*)/.exec(f)||["","","",""];g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];if(0==f[0].length&&0==g[0].length)break;c=v(0==f[1].length?0:parseInt(f[1],10),0==g[1].length?0:parseInt(g[1],10))||v(0==f[2].length,0==g[2].length)||v(f[2],g[2]);f=f[3];g=g[3]}while(0==c)}return c}function v(a,b){return a<b?-1:a>b?1:0};var w;a:{var oa=h.navigator;if(oa){var sa=oa.userAgent;if(sa){w=sa;break a}}w=""}function x(a){return-1!=w.indexOf(a)};function y(){return x("Firefox")||x("FxiOS")}function A(){return(x("Chrome")||x("CriOS"))&&!x("Edge")};function ta(a){return String(a).replace(/\-([a-z])/g,function(b,c){return c.toUpperCase()})};function B(){return x("iPhone")&&!x("iPod")&&!x("iPad")};function ua(a,b){var c=va;return Object.prototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var wa=x("Opera"),C=x("Trident")||x("MSIE"),xa=x("Edge"),ya=x("Gecko")&&!(-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge"))&&!(x("Trident")||x("MSIE"))&&!x("Edge"),za=-1!=w.toLowerCase().indexOf("webkit")&&!x("Edge");function Aa(){var a=h.document;return a?a.documentMode:void 0}var E;
|
|
12
|
+
a:{var F="",G=function(){var a=w;if(ya)return/rv:([^\);]+)(\)|;)/.exec(a);if(xa)return/Edge\/([\d\.]+)/.exec(a);if(C)return/\b(?:MSIE|rv)[: ]([^\);]+)(\)|;)/.exec(a);if(za)return/WebKit\/(\S+)/.exec(a);if(wa)return/(?:Version)[ \/]?(\S+)/.exec(a)}();G&&(F=G?G[1]:"");if(C){var H=Aa();if(null!=H&&H>parseFloat(F)){E=String(H);break a}}E=F}var va={};function Ba(a){return ua(a,function(){return 0<=na(E,a)})}var I;I=h.document&&C?Aa():void 0;var Ca=y(),Da=B()||x("iPod"),Ea=x("iPad"),Fa=x("Android")&&!(A()||y()||x("Opera")||x("Silk")),Ga=A(),Ha=x("Safari")&&!(A()||x("Coast")||x("Opera")||x("Edge")||x("Edg/")||x("OPR")||y()||x("Silk")||x("Android"))&&!(B()||x("iPad")||x("iPod"));function J(a){return(a=a.exec(w))?a[1]:""}(function(){if(Ca)return J(/Firefox\/([0-9.]+)/);if(C||xa||wa)return E;if(Ga)return B()||x("iPad")||x("iPod")?J(/CriOS\/([0-9.]+)/):J(/Chrome\/([0-9.]+)/);if(Ha&&!(B()||x("iPad")||x("iPod")))return J(/Version\/([0-9.]+)/);if(Da||Ea){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(w);if(a)return a[1]+"."+a[2]}else if(Fa)return(a=J(/Android\s+([0-9.]+)/))?a:J(/Version\/([0-9.]+)/);return""})();var K;if(K=C)K=!(9<=Number(I));var Ia=K;function L(a,b){this.x=void 0!==a?a:0;this.y=void 0!==b?b:0}L.prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};L.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};L.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function M(a,b){this.width=a;this.height=b}M.prototype.aspectRatio=function(){return this.width/this.height};M.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};M.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return this};M.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function N(a){return 9==a.nodeType?a:a.ownerDocument||a.document}function Ja(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}function Ka(a){this.a=a||h.document||document};function P(a,b){b&&"string"!==typeof b&&(b=b.toString());return a instanceof HTMLFormElement?!!a&&1==a.nodeType&&(!b||"FORM"==b):!!a&&1==a.nodeType&&(!b||a.tagName.toUpperCase()==b)};function Q(a,b,c,e){this.f=a;this.a=b;this.b=c;this.c=e}Q.prototype.ceil=function(){this.f=Math.ceil(this.f);this.a=Math.ceil(this.a);this.b=Math.ceil(this.b);this.c=Math.ceil(this.c);return this};Q.prototype.floor=function(){this.f=Math.floor(this.f);this.a=Math.floor(this.a);this.b=Math.floor(this.b);this.c=Math.floor(this.c);return this};Q.prototype.round=function(){this.f=Math.round(this.f);this.a=Math.round(this.a);this.b=Math.round(this.b);this.c=Math.round(this.c);return this};function R(a,b,c,e){this.a=a;this.b=b;this.width=c;this.height=e}R.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};R.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};
|
|
13
13
|
R.prototype.round=function(){this.a=Math.round(this.a);this.b=Math.round(this.b);this.width=Math.round(this.width);this.height=Math.round(this.height);return this};var La="function"===typeof ShadowRoot;function S(a){for(a=a.parentNode;a&&1!=a.nodeType&&9!=a.nodeType&&11!=a.nodeType;)a=a.parentNode;return P(a)?a:null}
|
|
14
14
|
function T(a,b){b=ta(b);if("float"==b||"cssFloat"==b||"styleFloat"==b)b=Ia?"styleFloat":"cssFloat";a:{var c=b;var e=N(a);if(e.defaultView&&e.defaultView.getComputedStyle&&(e=e.defaultView.getComputedStyle(a,null))){c=e[c]||e.getPropertyValue(c)||"";break a}c=""}a=c||Ma(a,b);if(null===a)a=null;else if(0<=da(ia,b)){b:{var d=a.match(la);if(d&&(b=Number(d[1]),c=Number(d[2]),e=Number(d[3]),d=Number(d[4]),0<=b&&255>=b&&0<=c&&255>=c&&0<=e&&255>=e&&0<=d&&1>=d)){b=[b,c,e,d];break b}b=null}if(!b)b:{if(e=a.match(ma))if(b=
|
|
15
15
|
Number(e[1]),c=Number(e[2]),e=Number(e[3]),0<=b&&255>=b&&0<=c&&255>=c&&0<=e&&255>=e){b=[b,c,e,1];break b}b=null}if(!b)b:{b=a.toLowerCase();c=ha[b.toLowerCase()];if(!c&&(c="#"==b.charAt(0)?b:"#"+b,4==c.length&&(c=c.replace(ja,"#$1$1$2$2$3$3")),!ka.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}
|
|
16
16
|
function Ma(a,b){var c=a.currentStyle||a.style,e=c[b];void 0===e&&"function"==aa(c.getPropertyValue)&&(e=c.getPropertyValue(b));return"inherit"!=e?void 0!==e?e:null:(a=S(a))?Ma(a,b):null}
|
|
17
|
-
function U(a,b,c){function e(
|
|
18
|
-
|
|
19
|
-
function Na(a){function b(k){function l(ba){if(ba==
|
|
20
|
-
function e(k){if(k==
|
|
21
|
-
|
|
17
|
+
function U(a,b,c){function e(g){var n=V(g);if(0<n.height&&0<n.width)return!0;if(P(g,"PATH")&&(0<n.height||0<n.width))return g=T(g,"stroke-width"),!!g&&0<parseInt(g,10);n=T(g,"visibility");return"collapse"!=n&&"hidden"!=n&&c(g)?"hidden"!=T(g,"overflow")&&ea(g.childNodes,function(D){return 3==D.nodeType||P(D)&&e(D)}):!1}function d(g){return Na(g)==W&&fa(g.childNodes,function(n){return!P(n)||d(n)||!e(n)})}if(!P(a))throw Error("Argument to isShown must be of type Element");if(P(a,"BODY"))return!0;if(P(a,
|
|
18
|
+
"OPTION")||P(a,"OPTGROUP"))return a=Ja(a,function(g){return P(g,"SELECT")}),!!a&&U(a,!0,c);var f=Oa(a);if(f)return!!f.image&&0<f.rect.width&&0<f.rect.height&&U(f.image,b,c);if(P(a,"INPUT")&&"hidden"==a.type.toLowerCase()||P(a,"NOSCRIPT"))return!1;f=T(a,"visibility");return"collapse"!=f&&"hidden"!=f&&c(a)&&(b||0!=Pa(a))&&e(a)?!d(a):!1}var W="hidden";
|
|
19
|
+
function Na(a){function b(k){function l(ba){if(ba==g)return!0;var pa=T(ba,"display");return 0==pa.lastIndexOf("inline",0)||"contents"==pa||"absolute"==qa&&"static"==T(ba,"position")?!1:!0}var qa=T(k,"position");if("fixed"==qa)return ra=!0,k==g?null:g;for(k=S(k);k&&!l(k);)k=S(k);return k}function c(k){var l=k;if("visible"==D)if(k==g&&n)l=n;else if(k==n)return{x:"visible",y:"visible"};l={x:T(l,"overflow-x"),y:T(l,"overflow-y")};k==g&&(l.x="visible"==l.x?"auto":l.x,l.y="visible"==l.y?"auto":l.y);return l}
|
|
20
|
+
function e(k){if(k==g){var l=(new Ka(f)).a;k=l.scrollingElement?l.scrollingElement:za||"CSS1Compat"!=l.compatMode?l.body||l.documentElement:l.documentElement;l=l.parentWindow||l.defaultView;k=C&&Ba("10")&&l.pageYOffset!=k.scrollTop?new L(k.scrollLeft,k.scrollTop):new L(l.pageXOffset||k.scrollLeft,l.pageYOffset||k.scrollTop)}else k=new L(k.scrollLeft,k.scrollTop);return k}var d=Qa(a),f=N(a),g=f.documentElement,n=f.body,D=T(g,"overflow"),ra;for(a=b(a);a;a=b(a)){var r=c(a);if("visible"!=r.x||"visible"!=
|
|
21
|
+
r.y){var t=V(a);if(0==t.width||0==t.height)return W;var z=d.a<t.a,O=d.b<t.b;if(z&&"hidden"==r.x||O&&"hidden"==r.y)return W;if(z&&"visible"!=r.x||O&&"visible"!=r.y){z=e(a);O=d.b<t.b-z.y;if(d.a<t.a-z.x&&"visible"!=r.x||O&&"visible"!=r.x)return W;d=Na(a);return d==W?W:"scroll"}z=d.c>=t.a+t.width;t=d.f>=t.b+t.height;if(z&&"hidden"==r.x||t&&"hidden"==r.y)return W;if(z&&"visible"!=r.x||t&&"visible"!=r.y){if(ra&&(r=e(a),d.c>=g.scrollWidth-r.x||d.a>=g.scrollHeight-r.y))return W;d=Na(a);return d==W?W:"scroll"}}}return"none"}
|
|
22
22
|
function V(a){var b=Oa(a);if(b)return b.rect;if(P(a,"HTML"))return a=N(a),a=((a?a.parentWindow||a.defaultView:window)||window).document,a="CSS1Compat"==a.compatMode?a.documentElement:a.body,a=new M(a.clientWidth,a.clientHeight),new R(0,0,a.width,a.height);try{var c=a.getBoundingClientRect()}catch(e){return new R(0,0,0,0)}b=new R(c.left,c.top,c.right-c.left,c.bottom-c.top);C&&a.ownerDocument.body&&(a=N(a),b.a-=a.documentElement.clientLeft+a.body.clientLeft,b.b-=a.documentElement.clientTop+a.body.clientTop);
|
|
23
23
|
return b}
|
|
24
|
-
function Oa(a){var b=P(a,"MAP");if(!b&&!P(a,"AREA"))return null;var c=b?a:P(a.parentNode,"MAP")?a.parentNode:null,e=null,d=null;if(c&&c.name){e='*[usemap="#'+c.name+'"]';c=N(c);var f;if(f="function"!=aa(c.querySelector)&&C&&(C?0<=na(I,8):Ba(8))){f=c.querySelector;var
|
|
24
|
+
function Oa(a){var b=P(a,"MAP");if(!b&&!P(a,"AREA"))return null;var c=b?a:P(a.parentNode,"MAP")?a.parentNode:null,e=null,d=null;if(c&&c.name){e='*[usemap="#'+c.name+'"]';c=N(c);var f;if(f="function"!=aa(c.querySelector)&&C&&(C?0<=na(I,8):Ba(8))){f=c.querySelector;var g=typeof f;f=!("object"==g&&null!=f||"function"==g)}if(f)throw Error("CSS selection is not supported");if(!e)throw new m(32,"No selector specified");e=u(e);try{var n=c.querySelector(e)}catch(D){throw new m(32,"An invalid or illegal selector was specified");}if(e=
|
|
25
25
|
n&&1==n.nodeType?n:null)d=V(e),b||"default"==a.shape.toLowerCase()||(a=Ra(a),b=Math.min(Math.max(a.a,0),d.width),n=Math.min(Math.max(a.b,0),d.height),d=new R(b+d.a,n+d.b,Math.min(a.width,d.width-b),Math.min(a.height,d.height-n)))}return{image:e,rect:d||new R(0,0,0,0)}}
|
|
26
26
|
function Ra(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 R(b,c,a[2]-b,a[3]-c)}if("circle"==b&&3==a.length)return b=a[2],new R(a[0]-b,a[1]-b,2*b,2*b);if("poly"==b&&2<a.length){b=a[0];c=a[1];for(var e=b,d=c,f=2;f+1<a.length;f+=2)b=Math.min(b,a[f]),e=Math.max(e,a[f]),c=Math.min(c,a[f+1]),d=Math.max(d,a[f+1]);return new R(b,c,e-b,d-c)}return new R(0,0,0,0)}function Qa(a){a=V(a);return new Q(a.b,a.a+a.width,a.b+a.height,a.a)}
|
|
27
27
|
function Pa(a){if(Ia){if("relative"==T(a,"position"))return 1;a=T(a,"filter");return(a=a.match(/^alpha\(opacity=(\d*)\)/)||a.match(/^progid:DXImageTransform.Microsoft.Alpha\(Opacity=(\d*)\)/))?Number(a[1])/100:1}return Sa(a)}function Sa(a){var b=1,c=T(a,"opacity");c&&(b=Number(c));(a=S(a))&&(b*=Sa(a));return b};function Ta(a,b){function c(e){if(P(e)&&("none"==T(e,"display")||"hidden"==T(e,"content-visibility")))return!1;var d;if((d=e.parentNode)&&d.shadowRoot&&void 0!==e.assignedSlot)d=e.assignedSlot?e.assignedSlot.parentNode:null;else if(e.getDestinationInsertionPoints){var f=e.getDestinationInsertionPoints();0<f.length&&(d=f[f.length-1])}if(La&&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&&P(d,"DETAILS")&&!d.open&&!P(e,
|
|
28
|
-
"SUMMARY")?!1:!!d&&c(d):!0}return U(a,!!b,c)}var X=["se_exportedFunctionSymbol"],Y=
|
|
28
|
+
"SUMMARY")?!1:!!d&&c(d):!0}return U(a,!!b,c)}var X=["se_exportedFunctionSymbol"],Y=h;X[0]in Y||"undefined"==typeof Y.execScript||Y.execScript("var "+X[0]);for(var Z;X.length&&(Z=X.shift());)X.length||void 0===Ta?Y[Z]&&Y[Z]!==Object.prototype[Z]?Y=Y[Z]:Y=Y[Z]={}:Y[Z]=Ta;; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}
|
|
@@ -21,16 +21,13 @@ module Selenium
|
|
|
21
21
|
module WebDriver
|
|
22
22
|
class BiDi
|
|
23
23
|
class Cookies < Hash
|
|
24
|
-
def initialize(cookies = {})
|
|
25
|
-
super()
|
|
26
|
-
merge!(cookies)
|
|
27
|
-
end
|
|
28
|
-
|
|
29
24
|
def as_json
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
map do |name, val|
|
|
26
|
+
self[:name] = name.to_s
|
|
27
|
+
self[:value] = {type: 'string', value: val.to_s}
|
|
32
28
|
|
|
33
|
-
|
|
29
|
+
[compact]
|
|
30
|
+
end
|
|
34
31
|
end
|
|
35
32
|
end
|
|
36
33
|
end # BiDi
|
|
@@ -32,14 +32,18 @@ module Selenium
|
|
|
32
32
|
@method = nil
|
|
33
33
|
@url = nil
|
|
34
34
|
@body = nil
|
|
35
|
+
@headers = nil
|
|
36
|
+
@cookies = nil
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
def continue
|
|
40
|
+
cookies = @cookies&.as_json
|
|
41
|
+
headers = @headers&.as_json
|
|
38
42
|
network.continue_request(
|
|
39
43
|
id: id,
|
|
40
44
|
body: body,
|
|
41
|
-
cookies: cookies
|
|
42
|
-
headers: headers
|
|
45
|
+
cookies: cookies,
|
|
46
|
+
headers: headers,
|
|
43
47
|
method: method,
|
|
44
48
|
url: url
|
|
45
49
|
)
|
|
@@ -56,13 +60,21 @@ module Selenium
|
|
|
56
60
|
}
|
|
57
61
|
end
|
|
58
62
|
|
|
59
|
-
def headers
|
|
60
|
-
@headers
|
|
63
|
+
def headers=(headers = {})
|
|
64
|
+
@headers = Headers.new(headers)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def headers(headers = {})
|
|
68
|
+
@headers ||= Headers.new(headers)
|
|
61
69
|
end
|
|
62
70
|
|
|
63
71
|
def cookies(cookies = {})
|
|
64
72
|
@cookies ||= Cookies.new(cookies)
|
|
65
73
|
end
|
|
74
|
+
|
|
75
|
+
def cookies=(cookies = {})
|
|
76
|
+
@cookies = Cookies.new(cookies)
|
|
77
|
+
end
|
|
66
78
|
end
|
|
67
79
|
end # BiDi
|
|
68
80
|
end # WebDriver
|
|
@@ -33,13 +33,17 @@ module Selenium
|
|
|
33
33
|
@reason = nil
|
|
34
34
|
@status = nil
|
|
35
35
|
@body = nil
|
|
36
|
+
@headers = nil
|
|
37
|
+
@cookies = nil
|
|
36
38
|
end
|
|
37
39
|
|
|
38
40
|
def continue
|
|
41
|
+
cookies = @cookies&.as_json
|
|
42
|
+
headers = @headers&.as_json
|
|
39
43
|
network.continue_response(
|
|
40
44
|
id: id,
|
|
41
|
-
cookies: cookies
|
|
42
|
-
headers: headers
|
|
45
|
+
cookies: cookies,
|
|
46
|
+
headers: headers,
|
|
43
47
|
credentials: credentials.as_json,
|
|
44
48
|
reason: reason,
|
|
45
49
|
status: status
|
|
@@ -47,10 +51,12 @@ module Selenium
|
|
|
47
51
|
end
|
|
48
52
|
|
|
49
53
|
def provide_response
|
|
54
|
+
cookies = @cookies&.as_json
|
|
55
|
+
headers = @headers&.as_json
|
|
50
56
|
network.provide_response(
|
|
51
57
|
id: id,
|
|
52
|
-
cookies: cookies
|
|
53
|
-
headers: headers
|
|
58
|
+
cookies: cookies,
|
|
59
|
+
headers: headers,
|
|
54
60
|
body: body,
|
|
55
61
|
reason: reason,
|
|
56
62
|
status: status
|
|
@@ -61,14 +67,22 @@ module Selenium
|
|
|
61
67
|
@credentials ||= Credentials.new(username: username, password: password)
|
|
62
68
|
end
|
|
63
69
|
|
|
64
|
-
def headers
|
|
65
|
-
@headers ||= Headers.new
|
|
70
|
+
def headers(headers = {})
|
|
71
|
+
@headers ||= Headers.new(headers)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def headers=(*headers)
|
|
75
|
+
@headers = Headers.new(headers)
|
|
66
76
|
end
|
|
67
77
|
|
|
68
78
|
def cookies(cookies = {})
|
|
69
79
|
@cookies ||= Cookies.new(cookies)
|
|
70
80
|
end
|
|
71
81
|
|
|
82
|
+
def cookies=(cookies = {})
|
|
83
|
+
@cookies ||= Cookies.new(cookies)
|
|
84
|
+
end
|
|
85
|
+
|
|
72
86
|
def body=(value)
|
|
73
87
|
@body = {
|
|
74
88
|
type: 'string',
|
|
@@ -82,15 +82,16 @@ module Selenium
|
|
|
82
82
|
end
|
|
83
83
|
|
|
84
84
|
def continue_request(**args)
|
|
85
|
-
|
|
86
|
-
'network.continueRequest',
|
|
85
|
+
args = {
|
|
87
86
|
request: args[:id],
|
|
88
87
|
body: args[:body],
|
|
89
88
|
cookies: args[:cookies],
|
|
90
89
|
headers: args[:headers],
|
|
91
90
|
method: args[:method],
|
|
92
91
|
url: args[:url]
|
|
93
|
-
|
|
92
|
+
}.compact
|
|
93
|
+
|
|
94
|
+
@bidi.send_cmd('network.continueRequest', **args)
|
|
94
95
|
end
|
|
95
96
|
|
|
96
97
|
def fail_request(request_id)
|
|
@@ -101,27 +102,29 @@ module Selenium
|
|
|
101
102
|
end
|
|
102
103
|
|
|
103
104
|
def continue_response(**args)
|
|
104
|
-
|
|
105
|
-
'network.continueResponse',
|
|
105
|
+
args = {
|
|
106
106
|
request: args[:id],
|
|
107
107
|
cookies: args[:cookies],
|
|
108
108
|
credentials: args[:credentials],
|
|
109
109
|
headers: args[:headers],
|
|
110
110
|
reasonPhrase: args[:reason],
|
|
111
111
|
statusCode: args[:status]
|
|
112
|
-
|
|
112
|
+
}.compact
|
|
113
|
+
|
|
114
|
+
@bidi.send_cmd('network.continueResponse', **args)
|
|
113
115
|
end
|
|
114
116
|
|
|
115
117
|
def provide_response(**args)
|
|
116
|
-
|
|
117
|
-
'network.provideResponse',
|
|
118
|
+
args = {
|
|
118
119
|
request: args[:id],
|
|
119
120
|
body: args[:body],
|
|
120
121
|
cookies: args[:cookies],
|
|
121
122
|
headers: args[:headers],
|
|
122
123
|
reasonPhrase: args[:reason],
|
|
123
124
|
statusCode: args[:status]
|
|
124
|
-
|
|
125
|
+
}.compact
|
|
126
|
+
|
|
127
|
+
@bidi.send_cmd('network.provideResponse', **args)
|
|
125
128
|
end
|
|
126
129
|
|
|
127
130
|
def set_cache_behavior(behavior, *contexts)
|
|
@@ -21,7 +21,6 @@ module Selenium
|
|
|
21
21
|
module WebDriver
|
|
22
22
|
class BiDi
|
|
23
23
|
autoload :Session, 'selenium/webdriver/bidi/session'
|
|
24
|
-
autoload :LogInspector, 'selenium/webdriver/bidi/log_inspector'
|
|
25
24
|
autoload :LogHandler, 'selenium/webdriver/bidi/log_handler'
|
|
26
25
|
autoload :Browser, 'selenium/webdriver/bidi/browser'
|
|
27
26
|
autoload :BrowsingContext, 'selenium/webdriver/bidi/browsing_context'
|
|
@@ -119,6 +119,13 @@ module Selenium
|
|
|
119
119
|
|
|
120
120
|
class NoSuchWindowError < WebDriverError; end
|
|
121
121
|
|
|
122
|
+
#
|
|
123
|
+
# A command to find a devtools target could not be satisfied because
|
|
124
|
+
# the target could not be found.
|
|
125
|
+
#
|
|
126
|
+
|
|
127
|
+
class NoSuchTargetError < WebDriverError; end
|
|
128
|
+
|
|
122
129
|
#
|
|
123
130
|
# The element does not have a shadow root.
|
|
124
131
|
#
|
|
@@ -84,7 +84,7 @@ module Selenium
|
|
|
84
84
|
def start_session(target_type:)
|
|
85
85
|
targets = target.get_targets.dig('result', 'targetInfos')
|
|
86
86
|
found_target = targets.find { |target| target['type'] == target_type }
|
|
87
|
-
raise Error::
|
|
87
|
+
raise Error::NoSuchTargetError, "Target type '#{target_type}' not found" unless found_target
|
|
88
88
|
|
|
89
89
|
session = target.attach_to_target(target_id: found_target['targetId'], flatten: true)
|
|
90
90
|
@session_id = session.dig('result', 'sessionId')
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: selenium-webdriver
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.39.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Rodionov
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2025-
|
|
13
|
+
date: 2025-12-06 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: base64
|
|
@@ -285,13 +285,7 @@ files:
|
|
|
285
285
|
- lib/selenium/webdriver/bidi.rb
|
|
286
286
|
- lib/selenium/webdriver/bidi/browser.rb
|
|
287
287
|
- lib/selenium/webdriver/bidi/browsing_context.rb
|
|
288
|
-
- lib/selenium/webdriver/bidi/log/base_log_entry.rb
|
|
289
|
-
- lib/selenium/webdriver/bidi/log/console_log_entry.rb
|
|
290
|
-
- lib/selenium/webdriver/bidi/log/filter_by.rb
|
|
291
|
-
- lib/selenium/webdriver/bidi/log/generic_log_entry.rb
|
|
292
|
-
- lib/selenium/webdriver/bidi/log/javascript_log_entry.rb
|
|
293
288
|
- lib/selenium/webdriver/bidi/log_handler.rb
|
|
294
|
-
- lib/selenium/webdriver/bidi/log_inspector.rb
|
|
295
289
|
- lib/selenium/webdriver/bidi/network.rb
|
|
296
290
|
- lib/selenium/webdriver/bidi/network/cookies.rb
|
|
297
291
|
- lib/selenium/webdriver/bidi/network/credentials.rb
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
|
5
|
-
# distributed with this work for additional information
|
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
|
8
|
-
# "License"); you may not use this file except in compliance
|
|
9
|
-
# with the License. You may obtain a copy of the License at
|
|
10
|
-
#
|
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
#
|
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
|
14
|
-
# software distributed under the License is distributed on an
|
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
# KIND, either express or implied. See the License for the
|
|
17
|
-
# specific language governing permissions and limitations
|
|
18
|
-
# under the License.
|
|
19
|
-
|
|
20
|
-
module Selenium
|
|
21
|
-
module WebDriver
|
|
22
|
-
class BiDi
|
|
23
|
-
class BaseLogEntry
|
|
24
|
-
attr_accessor :level, :text, :timestamp, :stack_trace
|
|
25
|
-
|
|
26
|
-
def initialize(level:, text:, timestamp:, stack_trace:)
|
|
27
|
-
@level = level
|
|
28
|
-
@text = text
|
|
29
|
-
@timestamp = timestamp
|
|
30
|
-
@stack_trace = stack_trace
|
|
31
|
-
end
|
|
32
|
-
end # BaseLogEntry
|
|
33
|
-
end # BiDi
|
|
34
|
-
end # WebDriver
|
|
35
|
-
end # Selenium
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
|
5
|
-
# distributed with this work for additional information
|
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
|
8
|
-
# "License"); you may not use this file except in compliance
|
|
9
|
-
# with the License. You may obtain a copy of the License at
|
|
10
|
-
#
|
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
#
|
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
|
14
|
-
# software distributed under the License is distributed on an
|
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
# KIND, either express or implied. See the License for the
|
|
17
|
-
# specific language governing permissions and limitations
|
|
18
|
-
# under the License.
|
|
19
|
-
|
|
20
|
-
module Selenium
|
|
21
|
-
module WebDriver
|
|
22
|
-
class BiDi
|
|
23
|
-
class ConsoleLogEntry < GenericLogEntry
|
|
24
|
-
attr_accessor :method, :realm, :args
|
|
25
|
-
|
|
26
|
-
def initialize(method:, realm:, args:, **)
|
|
27
|
-
super(**)
|
|
28
|
-
@method = method
|
|
29
|
-
@realm = realm
|
|
30
|
-
@args = args
|
|
31
|
-
end
|
|
32
|
-
end # ConsoleLogEntry
|
|
33
|
-
end # BiDi
|
|
34
|
-
end # WebDriver
|
|
35
|
-
end # Selenium
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
|
5
|
-
# distributed with this work for additional information
|
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
|
8
|
-
# "License"); you may not use this file except in compliance
|
|
9
|
-
# with the License. You may obtain a copy of the License at
|
|
10
|
-
#
|
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
#
|
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
|
14
|
-
# software distributed under the License is distributed on an
|
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
# KIND, either express or implied. See the License for the
|
|
17
|
-
# specific language governing permissions and limitations
|
|
18
|
-
# under the License.
|
|
19
|
-
|
|
20
|
-
module Selenium
|
|
21
|
-
module WebDriver
|
|
22
|
-
class BiDi
|
|
23
|
-
class FilterBy
|
|
24
|
-
attr_accessor :level
|
|
25
|
-
|
|
26
|
-
def initialize(level)
|
|
27
|
-
@level = level
|
|
28
|
-
end
|
|
29
|
-
|
|
30
|
-
def self.log_level(level = nil)
|
|
31
|
-
unless %w[debug error info warning].include?(level)
|
|
32
|
-
raise Error::WebDriverError,
|
|
33
|
-
"Valid log levels are 'debug', 'error', 'info' and 'warning'. Received: #{level}"
|
|
34
|
-
end
|
|
35
|
-
FilterBy.new(level)
|
|
36
|
-
end
|
|
37
|
-
end # FilterBy
|
|
38
|
-
end # BiDi
|
|
39
|
-
end # WebDriver
|
|
40
|
-
end # Selenium
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
|
5
|
-
# distributed with this work for additional information
|
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
|
8
|
-
# "License"); you may not use this file except in compliance
|
|
9
|
-
# with the License. You may obtain a copy of the License at
|
|
10
|
-
#
|
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
#
|
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
|
14
|
-
# software distributed under the License is distributed on an
|
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
# KIND, either express or implied. See the License for the
|
|
17
|
-
# specific language governing permissions and limitations
|
|
18
|
-
# under the License.
|
|
19
|
-
|
|
20
|
-
module Selenium
|
|
21
|
-
module WebDriver
|
|
22
|
-
class BiDi
|
|
23
|
-
class GenericLogEntry < BaseLogEntry
|
|
24
|
-
attr_accessor :type
|
|
25
|
-
|
|
26
|
-
def initialize(level:, text:, timestamp:, type:, stack_trace:)
|
|
27
|
-
super(level: level, text: text, timestamp: timestamp, stack_trace: stack_trace)
|
|
28
|
-
@type = type
|
|
29
|
-
end
|
|
30
|
-
end # GenericLogEntry
|
|
31
|
-
end # BiDi
|
|
32
|
-
end # WebDriver
|
|
33
|
-
end # Selenium
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
|
5
|
-
# distributed with this work for additional information
|
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
|
8
|
-
# "License"); you may not use this file except in compliance
|
|
9
|
-
# with the License. You may obtain a copy of the License at
|
|
10
|
-
#
|
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
#
|
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
|
14
|
-
# software distributed under the License is distributed on an
|
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
# KIND, either express or implied. See the License for the
|
|
17
|
-
# specific language governing permissions and limitations
|
|
18
|
-
# under the License.
|
|
19
|
-
|
|
20
|
-
module Selenium
|
|
21
|
-
module WebDriver
|
|
22
|
-
class BiDi
|
|
23
|
-
class JavascriptLogEntry < GenericLogEntry
|
|
24
|
-
attr_accessor :type
|
|
25
|
-
|
|
26
|
-
def initialize(level:, text:, timestamp:, type:, stack_trace:)
|
|
27
|
-
super
|
|
28
|
-
@type = 'javascript'
|
|
29
|
-
end
|
|
30
|
-
end # JavascriptLogEntry
|
|
31
|
-
end # BiDi
|
|
32
|
-
end # WebDriver
|
|
33
|
-
end # Selenium
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Licensed to the Software Freedom Conservancy (SFC) under one
|
|
4
|
-
# or more contributor license agreements. See the NOTICE file
|
|
5
|
-
# distributed with this work for additional information
|
|
6
|
-
# regarding copyright ownership. The SFC licenses this file
|
|
7
|
-
# to you under the Apache License, Version 2.0 (the
|
|
8
|
-
# "License"); you may not use this file except in compliance
|
|
9
|
-
# with the License. You may obtain a copy of the License at
|
|
10
|
-
#
|
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
#
|
|
13
|
-
# Unless required by applicable law or agreed to in writing,
|
|
14
|
-
# software distributed under the License is distributed on an
|
|
15
|
-
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
-
# KIND, either express or implied. See the License for the
|
|
17
|
-
# specific language governing permissions and limitations
|
|
18
|
-
# under the License.
|
|
19
|
-
|
|
20
|
-
# This file is automatically generated. Any changes will be lost!
|
|
21
|
-
|
|
22
|
-
require_relative 'log/base_log_entry'
|
|
23
|
-
require_relative 'log/generic_log_entry'
|
|
24
|
-
require_relative 'log/console_log_entry'
|
|
25
|
-
require_relative 'log/javascript_log_entry'
|
|
26
|
-
require_relative 'log/filter_by'
|
|
27
|
-
|
|
28
|
-
module Selenium
|
|
29
|
-
module WebDriver
|
|
30
|
-
class BiDi
|
|
31
|
-
class LogInspector
|
|
32
|
-
EVENTS = {
|
|
33
|
-
entry_added: 'entryAdded'
|
|
34
|
-
}.freeze
|
|
35
|
-
|
|
36
|
-
LOG_LEVEL = {
|
|
37
|
-
DEBUG: 'debug',
|
|
38
|
-
ERROR: 'error',
|
|
39
|
-
INFO: 'info',
|
|
40
|
-
WARNING: 'warning'
|
|
41
|
-
}.freeze
|
|
42
|
-
|
|
43
|
-
def initialize(driver, browsing_context_ids = nil)
|
|
44
|
-
WebDriver.logger.deprecate('LogInspector class',
|
|
45
|
-
'Script class with driver.script',
|
|
46
|
-
id: :log_inspector)
|
|
47
|
-
|
|
48
|
-
unless driver.capabilities.web_socket_url
|
|
49
|
-
raise Error::WebDriverError,
|
|
50
|
-
'WebDriver instance must support BiDi protocol'
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
@bidi = driver.bidi
|
|
54
|
-
@bidi.session.subscribe('log.entryAdded', browsing_context_ids)
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def on_console_entry(filter_by = nil, &block)
|
|
58
|
-
check_valid_filter(filter_by)
|
|
59
|
-
|
|
60
|
-
on_log do |params|
|
|
61
|
-
type = params['type']
|
|
62
|
-
console_log_events(params, filter_by, &block) if type.eql?('console')
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def on_javascript_log(filter_by = nil, &block)
|
|
67
|
-
check_valid_filter(filter_by)
|
|
68
|
-
|
|
69
|
-
on_log do |params|
|
|
70
|
-
type = params['type']
|
|
71
|
-
javascript_log_events(params, filter_by, &block) if type.eql?('javascript')
|
|
72
|
-
end
|
|
73
|
-
end
|
|
74
|
-
|
|
75
|
-
def on_javascript_exception(&block)
|
|
76
|
-
on_log do |params|
|
|
77
|
-
type = params['type']
|
|
78
|
-
javascript_log_events(params, FilterBy.log_level('error'), &block) if type.eql?('javascript')
|
|
79
|
-
end
|
|
80
|
-
end
|
|
81
|
-
|
|
82
|
-
def on_log(filter_by = nil, &block)
|
|
83
|
-
unless filter_by.nil?
|
|
84
|
-
check_valid_filter(filter_by)
|
|
85
|
-
|
|
86
|
-
on(:entry_added) do |params|
|
|
87
|
-
yield(params) if params['level'] == filter_by.level
|
|
88
|
-
end
|
|
89
|
-
return
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
on(:entry_added, &block)
|
|
93
|
-
end
|
|
94
|
-
|
|
95
|
-
private
|
|
96
|
-
|
|
97
|
-
def on(event, &block)
|
|
98
|
-
event = EVENTS[event] if event.is_a?(Symbol)
|
|
99
|
-
@bidi.add_callback("log.#{event}", &block)
|
|
100
|
-
end
|
|
101
|
-
|
|
102
|
-
def check_valid_filter(filter_by)
|
|
103
|
-
return if filter_by.nil? || filter_by.instance_of?(FilterBy)
|
|
104
|
-
|
|
105
|
-
raise "Pass valid FilterBy object. Received: #{filter_by.inspect}"
|
|
106
|
-
end
|
|
107
|
-
|
|
108
|
-
def console_log_events(params, filter_by)
|
|
109
|
-
event = ConsoleLogEntry.new(
|
|
110
|
-
level: params['level'],
|
|
111
|
-
text: params['text'],
|
|
112
|
-
timestamp: params['timestamp'],
|
|
113
|
-
type: params['type'],
|
|
114
|
-
method: params['method'],
|
|
115
|
-
realm: params['realm'],
|
|
116
|
-
args: params['args'],
|
|
117
|
-
stack_trace: params['stackTrace']
|
|
118
|
-
)
|
|
119
|
-
|
|
120
|
-
unless filter_by.nil?
|
|
121
|
-
yield(event) if params['level'] == filter_by.level
|
|
122
|
-
return
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
yield(event)
|
|
126
|
-
end
|
|
127
|
-
|
|
128
|
-
def javascript_log_events(params, filter_by)
|
|
129
|
-
event = JavascriptLogEntry.new(
|
|
130
|
-
level: params['level'],
|
|
131
|
-
text: params['text'],
|
|
132
|
-
timestamp: params['timestamp'],
|
|
133
|
-
type: params['type'],
|
|
134
|
-
stack_trace: params['stackTrace']
|
|
135
|
-
)
|
|
136
|
-
|
|
137
|
-
unless filter_by.nil?
|
|
138
|
-
yield(event) if params['level'] == filter_by.level
|
|
139
|
-
return
|
|
140
|
-
end
|
|
141
|
-
|
|
142
|
-
yield(event)
|
|
143
|
-
end
|
|
144
|
-
end # LogInspector
|
|
145
|
-
end # Bidi
|
|
146
|
-
end # WebDriver
|
|
147
|
-
end # Selenium
|