Skip to content

Commit

Permalink
fix(forefront): copy content
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangsx committed Jun 9, 2023
1 parent 0a0acef commit e30c95a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions model/forefront/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,11 @@ export class Forefrontnew extends Chat {
}
}

public static async copyContent(page: Page) {
await page.waitForSelector('.opacity-100 > .flex > .relative:nth-child(3) > .flex > .cursor-pointer', {timeout: 5 * 60 * 1000})
await page.click('.opacity-100 > .flex > .relative:nth-child(3) > .flex > .cursor-pointer')
}

public async askStream(req: Request): Promise<ResponseStream> {
const [page, account, done, destroy] = this.pagePool.get();
const pt = new WriteEventStream();
Expand Down Expand Up @@ -322,8 +327,7 @@ export class Forefrontnew extends Chat {
if (!page) {
return;
}
await page.waitForSelector('.opacity-100 > .flex > .relative:nth-child(2) > .flex > .cursor-pointer', {timeout: 5 * 60 * 1000})
await page.click('.opacity-100 > .flex > .relative:nth-child(2) > .flex > .cursor-pointer')
await Forefrontnew.copyContent(page);
//@ts-ignore
const text: any = await page.evaluate(() => navigator.clipboard.text);
console.log('chat end: ', text);
Expand Down

0 comments on commit e30c95a

Please sign in to comment.