Browse Source

Remove 429 retry loop

pull/46/head
coomdev 2 years ago
parent
commit
0e4537c44f
  1. 2
      main.meta.js
  2. 10
      main.user.js
  3. 7
      src/requests.ts

2
main.meta.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.206
// @version 0.207
// @description uhh
// @author You
// @match https://boards.4channel.org/*

10
main.user.js

@ -1,7 +1,7 @@
// ==UserScript==
// @name PNGExtraEmbed
// @namespace https://coom.tech/
// @version 0.206
// @version 0.207
// @description uhh
// @author You
// @match https://boards.4channel.org/*
@ -88,7 +88,7 @@ const _DOMParser = DOMParser;
var define_BUILD_VERSION_default;
var init_define_BUILD_VERSION = __esm({
"<define:BUILD_VERSION>"() {
define_BUILD_VERSION_default = [0, 206];
define_BUILD_VERSION_default = [0, 207];
}
});
@ -13679,12 +13679,6 @@ const _DOMParser = DOMParser;
reject(new Error("Server Error: " + resp.status));
return;
}
if (resp.status == 429) {
setTimeout(() => {
GM_fetch(url, opt, lisn).then(resolve2);
}, 1e3 + ~~(Math.random() * 5e3));
return;
}
const blob = resp.response;
const ref = resp;
ref.blob = () => Promise.resolve(blob);

7
src/requests.ts

@ -74,13 +74,6 @@ export let GM_fetch = (...[url, opt, lisn]: [...Parameters<typeof fetch>, EventT
reject(new Error("Server Error: " + resp.status));
return;
}
if (resp.status == 429) {
//retrying... fuck you
setTimeout(() => {
GM_fetch(url, opt, lisn).then(resolve);
}, 1000 + ~~(Math.random() * 5000));
return;
}
const blob = resp.response as Blob;
const ref = resp as any as Awaited<ReturnType<typeof fetch>>;
ref.blob = () => Promise.resolve(blob);

Loading…
Cancel
Save