gh_2215_make_GM_xhr_more_parallel_again

Go to https://github.com/Tampermonkey/tampermonkey/issues/2215 for more.

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.greasyfork.org/scripts/515994/1478507/gh_2215_make_GM_xhr_more_parallel_again.js

作者
ocrosoft
版本
1.0
建立日期
2024-11-06
更新日期
2024-11-06
授權條款
未知

/*
* https://github.com/Tampermonkey/tampermonkey/issues/2215
*
* This script provides a workaround for a Chrome MV3 issue (https://github.com/w3c/webextensions/issues/694)
* where extensions can't set/delete headers that are preserved over redirects.
*
* By setting `redirect: 'manual'` and following redirects manually, this script ensures request redirects work
* as intended and requests to different URLs are made in parallel (again).
*
* Userscript authors should include this as a `@require` when they need to make parallel requests with GM_xmlhttpRequest,
* especially if requests might take a long time to complete.
*
* Including this script will modify the behavior of GM_xmlhttpRequest and GM.xmlHttpRequest in Tampermonkey only.
*
* Usage:
*
* Add this to the metadata block of your userscript:
*
* // @grant GM_xmlhttpRequest
* // @require https://raw.githubusercontent.com/Tampermonkey/utils/refs/heads/main/requires/gh_2215_make_GM_xhr_more_parallel_again.js
*
**/