This commit is contained in:
liushiwei
2023-10-12 13:16:12 +08:00
parent 64edc19257
commit ce9bb7b15b
10 changed files with 1037 additions and 5 deletions

View File

@@ -24,6 +24,25 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
resolve(res.json());
});
}).then(sendResponse);
} else if (request.type == 'temuApi') {
new Promise((resolve) => {
let headers = {};
if (request.anti) {
headers["Anti-Content"] = request.anti
}
headers['Content-Type'] = 'application/json';
headers.cookie = getTemuCookie();
Promise.resolve().then(() => fetch(request.url, {
'headers': headers,
'method': 'POST',
'referrerPolicy': 'no-referrer',
'credentials': 'include',
'body': JSON.stringify(request.data),
'mode': 'cors'
})).then((res) => {
resolve(res.json());
});
}).then(sendResponse);
} else if (request.type == 'temu') {
new Promise((resolve) => {
let headers = {};