UNPKG

appium-remote-debugger

Version:
4 lines (3 loc) 2.84 kB
function(){return (function(){var b=this||self,c=Date.now||function(){return+new Date};function g(a,f){function d(){}d.prototype=f.prototype;a.prototype=new d;a.prototype.constructor=a};function k(a,f){this.code=a;this.b=l[a]||m;this.message=f||"";a=this.b.replace(/((?:^|\s+)[a-z])/g,function(d){return d.toUpperCase().replace(/^[\s\xa0]+/g,"")});f=a.length-5;if(0>f||a.indexOf("Error",f)!=f)a+="Error";this.name=a;a=Error(this.message);a.name=this.name;this.stack=a.stack||""}g(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";function n(a){return-1!=p.indexOf(a)};var p;a:{var q=b.navigator;if(q){var r=q.userAgent;if(r){p=r;break a}}p=""};function t(){return n("Firefox")||n("FxiOS")}function u(){return(n("Chrome")||n("CriOS"))&&!n("Edge")};function v(){return n("iPhone")&&!n("iPod")&&!n("iPad")};var w=t(),x=v()||n("iPod"),y=n("iPad"),z=n("Android")&&!(u()||t()||n("Opera")||n("Silk")),A=u(),B=n("Safari")&&!(u()||n("Coast")||n("Opera")||n("Edge")||n("Edg/")||n("OPR")||t()||n("Silk")||n("Android"))&&!(v()||n("iPad")||n("iPod"));function C(a){return(a=a.exec(p))?a[1]:""}(function(){if(w)return C(/Firefox\/([0-9.]+)/);if(A)return v()||n("iPad")||n("iPod")?C(/CriOS\/([0-9.]+)/):C(/Chrome\/([0-9.]+)/);if(B&&!(v()||n("iPad")||n("iPod")))return C(/Version\/([0-9.]+)/);if(x||y){var a=/Version\/(\S+).*Mobile\/(\S+)/.exec(p);if(a)return a[1]+"."+a[2]}else if(z)return(a=C(/Android\s+([0-9.]+)/))?a:C(/Version\/([0-9.]+)/);return""})();function D(a,f){a=decodeURIComponent(a);f=f||document;var d=f||document;var e=d.$wdc_;e||(e=d.$wdc_={},e.a=c());e.a||(e.a=c());d=e;if(!(null!==d&&a in d))throw new k(10,"Element does not exist in cache");e=d[a];if(null!==e&&"setInterval"in e){if(e.closed)throw delete d[a],new k(23,"Window has been closed.");return e}for(var h=e;h;){if(h==f.documentElement)return e;h.host&&11===h.nodeType&&(h=h.host);h=h.parentNode}delete d[a];throw new k(10,"Element is no longer attached to the DOM");} var E=["se_exportedFunctionSymbol"],F=b;E[0]in F||"undefined"==typeof F.execScript||F.execScript("var "+E[0]);for(var G;E.length&&(G=E.shift());)E.length||void 0===D?F[G]&&F[G]!==Object.prototype[G]?F=F[G]:F=F[G]={}:F[G]=D;; return this.se_exportedFunctionSymbol.apply(null,arguments);}).apply(window, arguments);}