mirror of
https://github.com/pacnpal/Roo-Code.git
synced 2025-12-20 12:21:13 -05:00
Use networkidle0 for inspect_site
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
"name": "claude-dev",
|
"name": "claude-dev",
|
||||||
"displayName": "Claude Dev",
|
"displayName": "Claude Dev",
|
||||||
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
|
"description": "Autonomous coding agent right in your IDE, capable of creating/editing files, executing commands, and more with your permission every step of the way.",
|
||||||
"version": "1.9.0",
|
"version": "1.9.1",
|
||||||
"icon": "icons/icon.png",
|
"icon": "icons/icon.png",
|
||||||
"galleryBanner": {
|
"galleryBanner": {
|
||||||
"color": "#1E1E1E",
|
"color": "#1E1E1E",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import * as vscode from "vscode"
|
import * as vscode from "vscode"
|
||||||
import * as fs from "fs/promises"
|
import * as fs from "fs/promises"
|
||||||
import * as path from "path"
|
import * as path from "path"
|
||||||
import { Browser, Page, launch } from "puppeteer-core"
|
import { Browser, Page, TimeoutError, launch } from "puppeteer-core"
|
||||||
import * as cheerio from "cheerio"
|
import * as cheerio from "cheerio"
|
||||||
import TurndownService from "turndown"
|
import TurndownService from "turndown"
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -113,13 +113,12 @@ export class UrlContentFetcher {
|
|||||||
})
|
})
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// networkidle2 is a good point to take a screenshot without having to wait for the timeout to hit if the site never reaches networkidle0
|
// networkidle2 isn't good enough since page may take some time to load. we can assume locally running dev sites will reach networkidle0 in a reasonable amount of time
|
||||||
await this.page.goto(url, { timeout: 10_000, waitUntil: ["domcontentloaded", "networkidle2"] })
|
await this.page.goto(url, { timeout: 7_000, waitUntil: ["domcontentloaded", "networkidle0"] })
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
// if (!(err instanceof TimeoutError)) {
|
if (!(err instanceof TimeoutError)) {
|
||||||
// logs.push(`[Navigation Error] ${err.toString()}`)
|
logs.push(`[Navigation Error] ${err.toString()}`)
|
||||||
// }
|
}
|
||||||
logs.push(`[Navigation Error] ${err.toString()}`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Wait for console inactivity, with a timeout
|
// Wait for console inactivity, with a timeout
|
||||||
|
|||||||
Reference in New Issue
Block a user