TM_request

Tampermonkey http request 库

Tento skript by neměl být instalován přímo. Jedná se o knihovnu, kterou by měly jiné skripty využívat pomocí meta příkazu // @require https://update.greasyfork.org/scripts/418102/1637925/TM_request.js

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

You will need to install an extension such as Tampermonkey to install this script.

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

"use strict";function asyncGeneratorStep(t,e,n,r,o,u,a){try{var i=t[u](a);var s=i.value}catch(t){n(t);return}if(i.done){e(s)}else{Promise.resolve(s).then(r,o)}}function _asyncToGenerator(i){return function(){var t=this,a=arguments;return new Promise(function(e,n){var r=i.apply(t,a);function o(t){asyncGeneratorStep(r,e,n,o,u,"next",t)}function u(t){asyncGeneratorStep(r,e,n,o,u,"throw",t)}o(undefined)})}}function TM_request(r){var t;var o=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;r.retry=(t=r.retry)!==null&&t!==void 0?t:0;return new Promise(function(e,t){r.onload=r.onload||function(t){t.requestOptions=r;t.tmStatusText="Load";e(t)};r.ontimeout=r.ontimeout||function(t){t.requestOptions=r;t.tmStatusText="Timeout";e(t)};r.onerror=r.onerror||function(t){t.requestOptions=r;t.tmStatusText="Error";e(t)};r.onabort=r.onabort||function(t){t.requestOptions=r;t.tmStatusText="Abort";e(t)};GM_xmlhttpRequest(r)}).then(function(t){return t})["catch"](function(){var e=_asyncToGenerator(regeneratorRuntime.mark(function t(n){return regeneratorRuntime.wrap(function t(e){while(1){switch(e.prev=e.next){case 0:if(!(o>=r.retry)){e.next=5;break}console.error(n);throw n;case 5:e.next=7;return TM_request(r,++o);case 7:return e.abrupt("return",e.sent);case 8:case"end":return e.stop()}}},t)}));return function(t){return e.apply(this,arguments)}}())}