We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
看文档里说GM_xmlhttpRequest 支持修改特殊的headers项,还特意举例了Origin和Referer,但我手动设置包括这两个在内的几个headers发现无法修改,在实际发送的headers里我修改的项目会变成以x-cat-7fb067ca-b2d6-4a17-8b95-d7d0827256ea-开头的项加在最后。 例如:设置了几个特殊headers
GM_xmlhttpRequest({ method: 'POST', url: 'https://data.sonkwo.com/analysis/event/collect', headers: { "Content-Type": "application/json", "Origin": "https://www.sonkwo.cn", "Referer": "https://www.sonkwo.cn/", "Sec-Fetch-Site": "cross-site" }, data: JSON.stringify({ "eventType":"indexSignin", "eventTime":Math.round(new Date()), "client":"index_native_pc", "detailParameter":{ "uuid":uuid, "rcode":null, "userid":id } }) });
但实际上发出去的请求headers相关部分是这样的
Content-Type: application/json Host: data.sonkwo.com Origin: chrome-extension://liilgpjgabokdklappibcjfablkpcekh Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: none x-cat-7fb067ca-b2d6-4a17-8b95-d7d0827256ea-gm-xhr: true x-cat-7fb067ca-b2d6-4a17-8b95-d7d0827256ea-origin: https://www.sonkwo.cn x-cat-7fb067ca-b2d6-4a17-8b95-d7d0827256ea-referer: https://www.sonkwo.cn/ x-cat-7fb067ca-b2d6-4a17-8b95-d7d0827256ea-sec-fetch-site: cross-site
只有Content-Type修改成功了
The text was updated successfully, but these errors were encountered:
你是在什么环境运行的呢?我这里测试OK
是后台脚本的调试模式吗?
Sorry, something went wrong.
是的,写的一个定时脚本,在脚本猫的编辑器调试的时候会这样
调试时暂不支持修改unsafe header,过两个版本处理一下
No branches or pull requests
看文档里说GM_xmlhttpRequest 支持修改特殊的headers项,还特意举例了Origin和Referer,但我手动设置包括这两个在内的几个headers发现无法修改,在实际发送的headers里我修改的项目会变成以x-cat-7fb067ca-b2d6-4a17-8b95-d7d0827256ea-开头的项加在最后。
例如:设置了几个特殊headers
但实际上发出去的请求headers相关部分是这样的
只有Content-Type修改成功了
The text was updated successfully, but these errors were encountered: