Spaces:
Sleeping
Sleeping
Update src/index.ts
Browse files- src/index.ts +35 -0
src/index.ts
CHANGED
@@ -69,7 +69,42 @@ async function initGensparkPage(cookies?: any[]) {
|
|
69 |
get: () => userAgent.replace('HeadlessChrome', 'Chrome'),
|
70 |
});
|
71 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
|
74 |
|
75 |
});
|
|
|
69 |
get: () => userAgent.replace('HeadlessChrome', 'Chrome'),
|
70 |
});
|
71 |
}
|
72 |
+
// 添加假的插件信息
|
73 |
+
Object.defineProperty(navigator, 'plugins', {
|
74 |
+
get: () => {
|
75 |
+
return [
|
76 |
+
{
|
77 |
+
description: "Portable Document Format",
|
78 |
+
filename: "internal-pdf-viewer",
|
79 |
+
name: "Chrome PDF Plugin"
|
80 |
+
},
|
81 |
+
{
|
82 |
+
description: "Portable Document Format",
|
83 |
+
filename: "mhjfbmdgcfjbbpaeojofohoefgiehjai",
|
84 |
+
name: "Chrome PDF Viewer"
|
85 |
+
},
|
86 |
+
{
|
87 |
+
description: "Widevine Content Decryption Module",
|
88 |
+
filename: "widevinecdmadapter.dll",
|
89 |
+
name: "Widevine Content Decryption Module"
|
90 |
+
}
|
91 |
+
];
|
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 |
});
|