Spaces:
Paused
Paused
Update src/index.ts
Browse files- src/index.ts +12 -2
src/index.ts
CHANGED
|
@@ -35,8 +35,18 @@ async function initGensparkPage(cookies?: any[]) {
|
|
| 35 |
|
| 36 |
if (!gensparkContext) {
|
| 37 |
gensparkContext = await browser.newContext({
|
| 38 |
-
|
| 39 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
})
|
| 41 |
}
|
| 42 |
if (cookies && cookies.length > 0) {
|
|
|
|
| 35 |
|
| 36 |
if (!gensparkContext) {
|
| 37 |
gensparkContext = await browser.newContext({
|
| 38 |
+
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36',
|
| 39 |
+
viewport: { width: 1920, height: 1080 },
|
| 40 |
+
deviceScaleFactor: 1,
|
| 41 |
+
hasTouch: false,
|
| 42 |
+
locale: 'en-US',
|
| 43 |
+
timezoneId: 'America/New_York',
|
| 44 |
+
geolocation: { longitude: -73.935242, latitude: 40.730610 }, // 纽约坐标,可根据需要调整
|
| 45 |
+
permissions: ['geolocation'],
|
| 46 |
+
javaScriptEnabled: true,
|
| 47 |
+
bypassCSP: true, // 绕过内容安全策略
|
| 48 |
+
colorScheme: 'light',
|
| 49 |
+
acceptDownloads: true,
|
| 50 |
})
|
| 51 |
}
|
| 52 |
if (cookies && cookies.length > 0) {
|