Spaces:
Running
Running
github-actions[bot]
commited on
Commit
·
0f18588
1
Parent(s):
445b4c2
Update from GitHub Actions
Browse files- src/index.ts +4 -1
src/index.ts
CHANGED
@@ -198,6 +198,9 @@ app.get('/genspark', async (c) => {
|
|
198 |
// Parse cookies into an array of objects with name and value properties
|
199 |
const cookies = cookieString.split(';').map(cookie => {
|
200 |
const [name, value] = cookie.trim().split('=');
|
|
|
|
|
|
|
201 |
return { name, value, domain: 'www.genspark.ai', path: '/' };
|
202 |
}).filter(cookie => cookie.name && cookie.value);
|
203 |
|
@@ -239,7 +242,7 @@ app.get('/genspark', async (c) => {
|
|
239 |
// 使用精确的选择器定位输入框
|
240 |
// 多种定位方式供选择
|
241 |
const inputSelector = 'textarea[name="query"].search-input';
|
242 |
-
|
243 |
// 等待输入框出现
|
244 |
await gensparkPage.waitForSelector(inputSelector, { state: 'visible', timeout: 5000 });
|
245 |
gensparkPage.focus(inputSelector);
|
|
|
198 |
// Parse cookies into an array of objects with name and value properties
|
199 |
const cookies = cookieString.split(';').map(cookie => {
|
200 |
const [name, value] = cookie.trim().split('=');
|
201 |
+
if (name.startsWith("_ga")) {
|
202 |
+
return { name, value, domain: 'genspark.ai', path: '/' };
|
203 |
+
}
|
204 |
return { name, value, domain: 'www.genspark.ai', path: '/' };
|
205 |
}).filter(cookie => cookie.name && cookie.value);
|
206 |
|
|
|
242 |
// 使用精确的选择器定位输入框
|
243 |
// 多种定位方式供选择
|
244 |
const inputSelector = 'textarea[name="query"].search-input';
|
245 |
+
|
246 |
// 等待输入框出现
|
247 |
await gensparkPage.waitForSelector(inputSelector, { state: 'visible', timeout: 5000 });
|
248 |
gensparkPage.focus(inputSelector);
|