chrome 或 firefox 扩展后台请求中的 cookie 禁用或私有模式
cookie disabled or private mode in chrome or firefox extension background request
我正在为 Firefox 或 chrome 创建一个扩展程序,我想用这个扩展程序代表我喜欢我的帖子。
Everliker 做我想做的但我想写它因为我们不能使用这个扩展专业计划我们不能购买它(美国抵制我们和 google 以及 everliker 的付款是基于 google 付款:|).
所以我想自己创建它并且它运行良好但只有一个问题!!
当我想给帖子点赞时:
var r = {
method: "POST",
headers: {
Accept: "application/json, text/javascript, */*; q=0.01",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-CSRFToken": '9CdUSqRg9E48Yzcrl1DJfsjYYI8fEeci',
"X-Instagram-Ajax": "1",
'Origin': 'https://www.instagram.com',
"X-Requested-With": "XMLHttpRequest"
},
credentials: "include"
};
console.log(fetch(likeUrl, r, n).then(this._toJson))
我收到这个错误:
如果图片没有出现,这是错误:
Error
This page could not be loaded. If you have cookies disabled in your
browser, or you are browsing in Private Mode, please try enabling
cookies or turning off Private Mode, and then retrying your action.
我不知道应该如何 headers 或如何启用带有 headers 的 cookie 作为引用此错误!
我将不胜感激任何建议或帮助谢谢
我找到了答案 chrome.webRequest.onBeforSendHeaders.addListener();
我正在为 Firefox 或 chrome 创建一个扩展程序,我想用这个扩展程序代表我喜欢我的帖子。
Everliker 做我想做的但我想写它因为我们不能使用这个扩展专业计划我们不能购买它(美国抵制我们和 google 以及 everliker 的付款是基于 google 付款:|).
所以我想自己创建它并且它运行良好但只有一个问题!! 当我想给帖子点赞时:
var r = {
method: "POST",
headers: {
Accept: "application/json, text/javascript, */*; q=0.01",
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
"X-CSRFToken": '9CdUSqRg9E48Yzcrl1DJfsjYYI8fEeci',
"X-Instagram-Ajax": "1",
'Origin': 'https://www.instagram.com',
"X-Requested-With": "XMLHttpRequest"
},
credentials: "include"
};
console.log(fetch(likeUrl, r, n).then(this._toJson))
我收到这个错误:
Error
This page could not be loaded. If you have cookies disabled in your browser, or you are browsing in Private Mode, please try enabling cookies or turning off Private Mode, and then retrying your action.
我不知道应该如何 headers 或如何启用带有 headers 的 cookie 作为引用此错误!
我将不胜感激任何建议或帮助谢谢
我找到了答案 chrome.webRequest.onBeforSendHeaders.addListener();