window = global
document = {}
document.all = {} // 全局搜索document.all发现并没有检测,因此这里不补typeof
navigator = {}
navigator.userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'
document.createElement = function (name) {
if (name == 'span') {
return [{}]
}
}
document.documentElement = '<html></html>'
document.createEvent = function () {
return 'createEvent() { [native code] }'
}
document.createElement = function () {
return 'createElement() { [native code] }'
}
window.requestAnimationFrame = function () {
return 'requestAnimationFrame() { [native code] }'
}
window._sdkGlueVersionMap = {
"sdkGlueVersion": "1.0.0.51",
"bdmsVersion": "1.0.1.5",
"captchaVersion": "4.0.2"
}
XMLHttpRequest = function () {
return 'XMLHttpRequest() { [native code] }'
}
window.fetch = function () {
return `(input, init) {
var _this6 = this;
var url, method;
if (IS_REQUEST_API_SUPPORTED && input instanceof Request) {
url = input.url;
method = input.method…`
}
window.onwheelx = {
"_Ax": "0X21"
}
navigator.vendorSubs = {
"ink": 1718453241914
}
window.innerWidth = 1920
window.innerHeight = 1080
window.outerWidth = 1914
window.outerHeight = 1026
window.screenX = 2563
window.screenY = 412
window.pageYOffset = 0
window.pageYOffset = 0
window.screen = {
availWidth: 1920,
availHeight: 1032,
width: 1920,
height: 1080,
colorDepth: 24,
pixelDepth: 24,
orientation: {
type: "landscape-primary",
angle: 0
},
};
navigator.platform = 'Win32'
document.body = '<body></body>'
// window.requestAnimationFrame = function () {}
// window.XMLHttpRequest = function () {}
// 挂代理补环境
function setProxy(proxyObjs) {
for (let i = 0; i < proxyObjs.length; i++) {
const handler = `{
get: function(target, property, receiver) {
if (property!="Math" && property!="isNaN"){
if (target[property] && typeof target[property] !="string" && Object.keys(target[property]).length>3){
}else{
console.log("方法:", "get ", "对象:", "${proxyObjs[i]}", " 属性:", property, " 属性类型:", typeof property, ", 属性值:", target[property]);}}
return target[property];
},
set: function(target, property, value, receiver) {
console.log("方法:", "set ", "对象:", "${proxyObjs[i]}", " 属性:", property, " 属性类型:", typeof property, ", 属性值:", value, ", 属性值类型:", typeof target[property]);
return Reflect.set(...arguments);
}
}`;
eval(`try {
${proxyObjs[i]};
${proxyObjs[i]} = new Proxy(${proxyObjs[i]}, ${handler});
} catch (e) {
${proxyObjs[i]} = {};
${proxyObjs[i]} = new Proxy(${proxyObjs[i]}, ${handler});
}`);
}
}
setProxy(['window', 'document', ' navigator', 'screen', 'localStorage', 'location'])
某音 js 补环境代码块,通配基础环境
于 2024-08-12 14:29:58 首次发布