Advertisement
Guest User

Untitled

a guest
May 22nd, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. !function() {
  2. let $ = window.$;
  3. let _ajax = $.ajax;
  4. $.ajax = function(opt) {
  5. let req = _ajax.apply(this, arguments);
  6. if (typeof opt.url == "string" && opt.url.indexOf("engine?t=") > -1) onRequest(req);
  7. return req;
  8. };
  9.  
  10. let __g = window._g;
  11. let lastArgs = [];
  12. window._g = function() {
  13. lastArgs = arguments;
  14. return __g.apply(this, arguments);
  15. };
  16.  
  17. function onRequest(req) {
  18. setTimeout(() => {
  19. if (req.readyState != 4) {
  20. console.log("resend request");
  21. req.abort();
  22. g.ats = 0;
  23. __g.apply(window, lastArgs);
  24. };
  25. }, 5000);
  26. };
  27. }();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement