Spaces:
Paused
Paused
Update src/index.ts
Browse files- src/index.ts +34 -34
src/index.ts
CHANGED
|
@@ -68,44 +68,44 @@ async function initGensparkPage(cookies?: any[]) {
|
|
| 68 |
})
|
| 69 |
|
| 70 |
// Override specific browser properties to avoid detection
|
| 71 |
-
await gensparkPage.addInitScript(() => {
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
|
| 90 |
-
});
|
| 91 |
// Simulate human-like behavior
|
| 92 |
-
await gensparkPage.addInitScript(() => {
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
});
|
| 109 |
console.log('GenSpark页面已初始化')
|
| 110 |
}
|
| 111 |
return gensparkPage
|
|
|
|
| 68 |
})
|
| 69 |
|
| 70 |
// Override specific browser properties to avoid detection
|
| 71 |
+
// await gensparkPage.addInitScript(() => {
|
| 72 |
+
// // Override the navigator properties
|
| 73 |
+
// Object.defineProperty(navigator, 'webdriver', { get: () => false });
|
| 74 |
+
// Object.defineProperty(navigator, 'plugins', { get: () => [1, 2, 3, 4, 5] });
|
| 75 |
+
// Object.defineProperty(navigator, 'languages', { get: () => ['en-US', 'en'] });
|
| 76 |
|
| 77 |
+
// // Add fake web audio and canvas fingerprints
|
| 78 |
+
// const originalGetImageData = CanvasRenderingContext2D.prototype.getImageData;
|
| 79 |
+
// CanvasRenderingContext2D.prototype.getImageData = function(x, y, w, h) {
|
| 80 |
+
// const imageData = originalGetImageData.call(this, x, y, w, h);
|
| 81 |
+
// // Add some noise to the canvas data
|
| 82 |
+
// for (let i = 0; i < imageData.data.length; i += 4) {
|
| 83 |
+
// imageData.data[i] = imageData.data[i] + Math.floor(Math.random() * 5);
|
| 84 |
+
// imageData.data[i+1] = imageData.data[i+1] + Math.floor(Math.random() * 5);
|
| 85 |
+
// imageData.data[i+2] = imageData.data[i+2] + Math.floor(Math.random() * 5);
|
| 86 |
+
// }
|
| 87 |
+
// return imageData;
|
| 88 |
+
// };
|
| 89 |
|
| 90 |
+
// });
|
| 91 |
// Simulate human-like behavior
|
| 92 |
+
// await gensparkPage.addInitScript(() => {
|
| 93 |
+
// // Add random mouse movements
|
| 94 |
+
// let lastMove = Date.now();
|
| 95 |
+
// document.addEventListener('mousemove', function() {
|
| 96 |
+
// lastMove = Date.now();
|
| 97 |
+
// }, true);
|
| 98 |
|
| 99 |
+
// // Simulate scroll behavior
|
| 100 |
+
// window.addEventListener('scroll', function() {
|
| 101 |
+
// // Random scroll speed
|
| 102 |
+
// const scrollSpeed = Math.floor(Math.random() * 10) + 5;
|
| 103 |
+
// const scrollAmount = Math.floor(Math.random() * 100);
|
| 104 |
+
// setTimeout(() => {
|
| 105 |
+
// window.scrollBy(0, scrollAmount);
|
| 106 |
+
// }, scrollSpeed);
|
| 107 |
+
// }, true);
|
| 108 |
+
// });
|
| 109 |
console.log('GenSpark页面已初始化')
|
| 110 |
}
|
| 111 |
return gensparkPage
|