获取anti_content完成

This commit is contained in:
2023-08-17 02:41:13 +08:00
parent e22a2b8910
commit d1de8a2379
4 changed files with 3588 additions and 1410 deletions

View File

@@ -1,12 +1,3 @@
/**
* 获取Anti-Content
*/
export const getAntiContent = message => {
message.type = "genAnti"
return new Promise((resolve) => {
chrome.runtime.sendMessage(message, resolve)
})
}
/**
利用chrome的fetch来避免跨域
**/
@@ -18,7 +9,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
headers.Mallid = request.mallId;
}
if (request.anti) {
headers["Anti-Content"] = getAntiContent()
headers["Anti-Content"] = request.anti
}
headers['Content-Type'] = 'application/json';
headers.cookie = getCookie();