-
-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
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请求携带Cookie的问题 #78
Comments
我也遇到了这个问题,使用 你可以试下: GM_xmlhttpRequest({
method: "GET",
url: <url>,
headers:{
"Cookie":"k1=v1;k2=v2"
},
anonymous: true,
onload: (res) => {
resolve(res)
}) |
这好像并不能解决我的问题(我当时试过)。这种传递cookie的方式也不能应用在tampermonkey上。现在我的脚本已经放弃了对stay的支持。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
你好,Stay的创作团队:
我在编写插件的时候发现GM_xmlHttpRequest在Stay里面似乎不能携带Cookie请求API.
我写的这个插件在Userscript和Tampermonkey都可以正常请求API并且获取正确的信息,但是唯独在Stay中运行,在请求API的时候返回了"验证失败,请重新登录"的数据,经过Postman进一步分析得出是Cookie的原因.
有什么办法能让GM_xmlHttpRequest函数携带Cookie请求API呢?
这是出问题的代码:
通过这段代码访问API时,不能够携带本地Cookie而导致API返回"验证失败,请重新登录".
已经试过并且无效的方法:
恳请Stay开发团队修复一下这个Bug或者给出一个解决方案!谢谢!
一个开发者,
2023.8.2
The text was updated successfully, but these errors were encountered: