Spaces:
Running
Running
Update src/index.ts
Browse files- src/index.ts +8 -15
src/index.ts
CHANGED
@@ -69,7 +69,14 @@ async function initGensparkPage(cookies?: any[]) {
|
|
69 |
get: () => userAgent.replace('HeadlessChrome', 'Chrome'),
|
70 |
});
|
71 |
}
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
Object.defineProperty(navigator, 'plugins', {
|
74 |
get: () => {
|
75 |
return [
|
@@ -92,20 +99,6 @@ async function initGensparkPage(cookies?: any[]) {
|
|
92 |
},
|
93 |
});
|
94 |
|
95 |
-
// 创建假的 WebGL 渲染器信息
|
96 |
-
const getParameter = WebGLRenderingContext.prototype.getParameter;
|
97 |
-
WebGLRenderingContext.prototype.getParameter = function (parameter) {
|
98 |
-
// UNMASKED_VENDOR_WEBGL
|
99 |
-
if (parameter === 37445) {
|
100 |
-
return 'Intel Inc.';
|
101 |
-
}
|
102 |
-
// UNMASKED_RENDERER_WEBGL
|
103 |
-
if (parameter === 37446) {
|
104 |
-
return 'Intel Iris OpenGL Engine';
|
105 |
-
}
|
106 |
-
return getParameter.call(this, parameter);
|
107 |
-
};
|
108 |
-
|
109 |
|
110 |
});
|
111 |
|
|
|
69 |
get: () => userAgent.replace('HeadlessChrome', 'Chrome'),
|
70 |
});
|
71 |
}
|
72 |
+
|
73 |
+
|
74 |
+
// 添加语言和插件,使其看起来更像真实浏览器
|
75 |
+
Object.defineProperty(navigator, 'languages', {
|
76 |
+
get: () => ['en-US', 'en', 'zh-CN'],
|
77 |
+
});
|
78 |
+
|
79 |
+
// 添加假的插件信息
|
80 |
Object.defineProperty(navigator, 'plugins', {
|
81 |
get: () => {
|
82 |
return [
|
|
|
99 |
},
|
100 |
});
|
101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
102 |
|
103 |
});
|
104 |
|