兼容异常,并给出示例

This commit is contained in:
aixianling
2024-04-23 15:10:24 +08:00
parent 482391d6d3
commit 45f727ed7e
4 changed files with 20 additions and 8 deletions

View File

@@ -131,8 +131,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
headers['Content-Type'] = 'text/html';
headers.cookie = getAliexpressCookie();
const {_m_h5_c, _m_h5_tk} = cookie2Obj(headers.cookie)
const {mtopConfig = {appKey: "12574478"}} = window
const {appKey = mtopConfig.appKey, formData} = request
const {appKey, formData} = request
const {sign, t} = getSign(_m_h5_c || _m_h5_tk, appKey, formData)
const url = new URL(request.url)
let params = new URLSearchParams(url.search);
@@ -253,7 +252,7 @@ function getSheinCookie() {
function getAliexpressCookie() {
const url = new URL("https://www.aliexpress.com/");
const url = new URL("https://csp.aliexpress.com/");
let cStr = '';
chrome.cookies.getAll({domain: url.host}, (cookie) => {
cookie.map((c) => {