免费试用风控比直接付费plus高,我这里同一张卡,付费可以买plus,免费试用过不去
一个跳过免费试用,直接付费买plus的脚本(粘贴到f12 console后点击领取免费试用)
(() => {
// 避免重复安装
if (window.__promoCampaignFetchHook) {
console.warn("[fetch hook] 已经安装,无需重复执行。");
return;
}
const originalFetch = window.fetch;
/**
* 尝试删除 JSON 文本中的顶层 promo_campaign 字段。
*/
function removePromoCampaign(bodyText) {
if (typeof bodyText !== "string" || !bodyText.trim()) {
return null;
}
try {
const data = JSON.parse(bodyText);
if (
data === null ||
typeof data !== "object" ||
Array.isArray(data) ||
!Object.prototype.hasOwnProperty.call(data, "promo_campaign")
) {
return null;
}
const removedValue = data.promo_campaign;
delete data.promo_campaign;
return {
body: JSON.stringify(data),
removedValue,
data,
};
} catch {
// 不是合法 JSON,不处理
return null;
}
}
window.fetch = async function hookedFetch(input, init) {
let requestUrl =
typeof input === "string"
? input
: input instanceof URL
? input.href
: input?.url;
/*
* 情况一:
* fetch(url, { body: JSON.stringify(...) })
* 或 fetch(request, { body: ... })
*/
if (init && typeof init.body === "string") {
const result = removePromoCampaign(init.body);
if (result) {
init = {
...init,
body: result.body,
};
console.log("[fetch hook] 已删除 promo_campaign", {
url: requestUrl,
removedValue: result.removedValue,
modifiedBody: result.data,
});
}
return originalFetch.call(this, input, init);
}
/*
* 情况二:
* fetch(new Request(url, { body: JSON.stringify(...) }))
*/
if (
input instanceof Request &&
!input.bodyUsed &&
!["GET", "HEAD"].includes(input.method.toUpperCase())
) {
try {
const bodyText = await input.clone().text();
const result = removePromoCampaign(bodyText);
if (result) {
const modifiedRequest = new Request(input, {
body: result.body,
});
console.log("[fetch hook] 已删除 promo_campaign", {
url: input.url,
removedValue: result.removedValue,
modifiedBody: result.data,
});
return originalFetch.call(this, modifiedRequest, init);
}
} catch (error) {
console.warn("[fetch hook] 检查 Request 请求体失败,已使用原请求:", error);
}
}
return originalFetch.call(this, input, init);
};
window.__promoCampaignFetchHook = {
uninstall() {
window.fetch = originalFetch;
delete window.__promoCampaignFetchHook;
console.log("[fetch hook] 已卸载。");
},
};
console.log(
"[fetch hook] 安装成功。卸载请执行:window.__promoCampaignFetchHook.uninstall()"
);
})();