Keep proxy_pool_enabled/managed off for direct registration, while shipping SSO OAuth CPA export, visible Turnstile click handling, and proxy harvest tooling.
78 lines
2.2 KiB
JavaScript
78 lines
2.2 KiB
JavaScript
// Turnstile Patch - 仅做指纹修补,不自动狂点。
|
||
// xAI 资料页是 managed/invisible Turnstile:iframe 0x0,token 会自动生成;
|
||
// 每 500ms 点 checkbox 反而会打断校验。
|
||
|
||
(function () {
|
||
"use strict";
|
||
|
||
// 0. 伪造 MouseEvent screen 坐标
|
||
try {
|
||
function _rnd(min, max) {
|
||
return Math.floor(Math.random() * (max - min + 1)) + min;
|
||
}
|
||
var _sx = _rnd(800, 1400);
|
||
var _sy = _rnd(300, 800);
|
||
Object.defineProperty(MouseEvent.prototype, "screenX", {
|
||
configurable: true,
|
||
get: function () {
|
||
return _sx + (this.clientX || 0);
|
||
},
|
||
});
|
||
Object.defineProperty(MouseEvent.prototype, "screenY", {
|
||
configurable: true,
|
||
get: function () {
|
||
return _sy + (this.clientY || 0);
|
||
},
|
||
});
|
||
} catch (e) {}
|
||
|
||
// 1. 隐藏 navigator.webdriver
|
||
try {
|
||
Object.defineProperty(navigator, "webdriver", {
|
||
get: function () {
|
||
return false;
|
||
},
|
||
configurable: true,
|
||
});
|
||
} catch (e) {}
|
||
|
||
// 2. 清理 chrome.runtime 自动化痕迹
|
||
try {
|
||
if (window.chrome && window.chrome.runtime) {
|
||
delete window.chrome.runtime.onConnect;
|
||
delete window.chrome.runtime.onMessage;
|
||
}
|
||
} catch (e) {}
|
||
|
||
// 3. permissions.query
|
||
try {
|
||
var origQuery = navigator.permissions.query.bind(navigator.permissions);
|
||
navigator.permissions.query = function (params) {
|
||
if (params.name === "notifications") {
|
||
return Promise.resolve({ state: Notification.permission });
|
||
}
|
||
return origQuery(params);
|
||
};
|
||
} catch (e) {}
|
||
|
||
// 4. plugins
|
||
try {
|
||
Object.defineProperty(navigator, "plugins", {
|
||
get: function () {
|
||
return [1, 2, 3, 4, 5];
|
||
},
|
||
configurable: true,
|
||
});
|
||
} catch (e) {}
|
||
|
||
// 5. languages
|
||
try {
|
||
Object.defineProperty(navigator, "languages", {
|
||
get: function () {
|
||
return ["en-US", "en"];
|
||
},
|
||
configurable: true,
|
||
});
|
||
} catch (e) {}
|
||
})();
|