GM_xmlhttpRequestでapplication/x-www-form-urlencodedを使う
GM_xmlhttpRequestでapplication/x-www-form-urlencodedを指定するときは、URLSearchParamsそのものを送ることは出来ない
代わりに文字列化して送る
code:js
const params = new URLSearchParams();
// ...
GM_xmlhttpRequest({
url: '...',
method: 'GET',
headers: {
'Content-Length': params.toString().length,
},
body: params.toString(),
onload: (res) => {/*...*/};
withCredentials: true,
});
Reference
Fetch API で x-www-form-urlencoded を直接指定することを避ける - Qiita
#2021-02-24 10:03:15