UNPKG

appium-remote-debugger

Version:
4 lines (3 loc) 3.34 kB
function(){return (function(){var b=this||self;function c(a,d){function e(){}e.prototype=d.prototype;a.prototype=new e;a.prototype.constructor=a};var f=window;function k(a,d){this.code=a;this.a=l[a]||m;this.message=d||"";a=this.a.replace(/((?:^|\s+)[a-z])/g,function(e){return e.toUpperCase().replace(/^[\s\xa0]+/g,"")});d=a.length-5;if(0>d||a.indexOf("Error",d)!=d)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}c(k,Error);var m="unknown error",l={15:"element not selectable",11:"element not visible"};l[31]=m;l[30]=m;l[24]="invalid cookie domain";l[29]="invalid element coordinates";l[12]="invalid element state";l[32]="invalid selector"; l[51]="invalid selector";l[52]="invalid selector";l[17]="javascript error";l[405]="unsupported operation";l[34]="move target out of bounds";l[27]="no such alert";l[7]="no such element";l[8]="no such frame";l[23]="no such window";l[28]="script timeout";l[33]="session not created";l[10]="stale element reference";l[21]="timeout";l[25]="unable to set cookie";l[26]="unexpected alert open";l[13]=m;l[9]="unknown command";var n=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\s\xa0]*([\s\S]*?)[\s\xa0]*$/.exec(a)[1]};function p(a){return-1!=q.indexOf(a)} function u(a,d){var e=0;a=n(String(a)).split(".");d=n(String(d)).split(".");for(var r=Math.max(a.length,d.length),t=0;0==e&&t<r;t++){var g=a[t]||"",h=d[t]||"";do{g=/(\d*)(\D*)(.*)/.exec(g)||["","","",""];h=/(\d*)(\D*)(.*)/.exec(h)||["","","",""];if(0==g[0].length&&0==h[0].length)break;e=v(0==g[1].length?0:parseInt(g[1],10),0==h[1].length?0:parseInt(h[1],10))||v(0==g[2].length,0==h[2].length)||v(g[2],h[2]);g=g[3];h=h[3]}while(0==e)}return e}function v(a,d){return a<d?-1:a>d?1:0};var q;a:{var w=b.navigator;if(w){var x=w.userAgent;if(x){q=x;break a}}q=""};function y(){return p("Firefox")||p("FxiOS")}function z(){return(p("Chrome")||p("CriOS"))&&!p("Edge")};function A(){return p("iPhone")&&!p("iPod")&&!p("iPad")};var B=p("Windows");var C=y(),D=A()||p("iPod"),E=p("iPad"),F=p("Android")&&!(z()||y()||p("Opera")||p("Silk")),G=z(),H=p("Safari")&&!(z()||p("Coast")||p("Opera")||p("Edge")||p("Edg/")||p("OPR")||y()||p("Silk")||p("Android"))&&!(A()||p("iPad")||p("iPod"));function I(a){return(a=a.exec(q))?a[1]:""}var J=function(){if(C)return I(/Firefox\/([0-9.]+)/);if(G)return A()||p("iPad")||p("iPod")?I(/CriOS\/([0-9.]+)/):I(/Chrome\/([0-9.]+)/);if(H&&!(A()||p("iPad")||p("iPod")))return I(/Version\/([0-9.]+)/);if(D||E){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(q);if(a)return a[1]+"."+a[2]}else if(F)return(a=I(/Android\s+([0-9.]+)/))?a:I(/Version\/([0-9.]+)/);return""}();var K;if(F){var L=/Android\s+([0-9\.]+)/.exec(q);K=L?L[1]:"0"}else K="0";var M=K;var N=B&&H&&(F?0<=u(M,4):0<=u(J,4))&&!(F?0<=u(M,6):0<=u(J,6));var O={enableHighAccuracy:!0,maximumAge:Infinity,timeout:5E3};function P(a,d,e){e=e||O;var r=f||f;if(N?0:null!=r.navigator&&null!=r.navigator.geolocation)f.navigator.geolocation.getCurrentPosition(a,d,e);else throw new k(13,"Geolocation undefined");}var Q=["se_exportedFunctionSymbol"],R=b;Q[0]in R||"undefined"==typeof R.execScript||R.execScript("var "+Q[0]);for(var S;Q.length&&(S=Q.shift());)Q.length||void 0===P?R[S]&&R[S]!==Object.prototype[S]?R=R[S]:R=R[S]={}:R[S]=P;; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}