GM_request

GM_xmlhttpRequest 的 Promise 封装,并增加 retry 功能

Bu script direkt olarak kurulamaz. Başka scriptler için bir kütüphanedir ve meta yönergeleri içerir // @require https://update.greasyfork.org/scripts/565272/1749537/GM_request.js

Bu betiği kurabilmeniz için Tampermonkey, Greasemonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

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

Bu betiği kurabilmeniz için Tampermonkey ya da Violentmonkey gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği kurabilmeniz için Tampermonkey ya da Userscripts gibi bir kullanıcı betiği eklentisini kurmanız gerekmektedir.

Bu betiği indirebilmeniz için ayrıca Tampermonkey gibi bir eklenti kurmanız gerekmektedir.

Bu komut dosyasını yüklemek için bir kullanıcı komut dosyası yöneticisi uzantısı yüklemeniz gerekecek.

(Zaten bir kullanıcı komut dosyası yöneticim var, kurmama izin verin!)

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.

(Zateb bir user-style yöneticim var, yükleyeyim!)

Yazar
ssnangua
Versiyon
0.0.1.20260205214102
Oluşturulma
05.02.2026
Güncellenme
05.02.2026
Boyut
1,07 KB
Lisans
N/A

需要在主脚本引入 GM_xmlhttpRequest

// @grant        GM_xmlhttpRequest

使用:

GM_request({
  // ...其他 GM_xmlhttpRequest 参数
  maxRetries: 5, // 重试次数
  // 重试回调
  onretry(details) {
    console.warn(
      `请求失败,正在重试:${details.currentRetry}/${details.maxRetries}`,
    );
  },
}).then((res) => {
  console.log(res.response);
});