mcpbrowser 0.3.30 → 0.3.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/page.js +6 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcpbrowser",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.32",
|
|
4
4
|
"mcpName": "io.github.cherchyk/mcpbrowser",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "MCP browser server - fetch web pages using real Chrome/Edge/Brave browser. Handles authentication, SSO, CAPTCHAs, and anti-bot protection. Browser automation for AI assistants.",
|
package/src/core/page.js
CHANGED
|
@@ -329,8 +329,11 @@ export async function waitForPageReady(page, { afterInteraction = false } = {})
|
|
|
329
329
|
if (initialContentLength < MIN_BODY_TEXT_LENGTH) reasons.push(`minimal body text (${initialContentLength} chars)`);
|
|
330
330
|
logger.debug(`Waiting for JS-rendered content: ${reasons.join('; ')}`);
|
|
331
331
|
|
|
332
|
+
// For non-SPA minimal pages (e.g., example.com), use a short settle to avoid long waits.
|
|
333
|
+
const maxWait = spaCheck.isSPA ? 10_000 : 2_000;
|
|
334
|
+
|
|
332
335
|
// Delegate to content renderer — polls DOM until content appears and stabilizes
|
|
333
|
-
await waitForContentToRender(page, initialContentLength);
|
|
336
|
+
await waitForContentToRender(page, initialContentLength, { maxWait });
|
|
334
337
|
}
|
|
335
338
|
|
|
336
339
|
/**
|
|
@@ -340,8 +343,8 @@ export async function waitForPageReady(page, { afterInteraction = false } = {})
|
|
|
340
343
|
* @param {number} initialContentLength - Content length at start of wait
|
|
341
344
|
* @returns {Promise<void>}
|
|
342
345
|
*/
|
|
343
|
-
async function waitForContentToRender(page, initialContentLength) {
|
|
344
|
-
|
|
346
|
+
async function waitForContentToRender(page, initialContentLength, { maxWait = 10_000 } = {}) {
|
|
347
|
+
// maxWait is overridable to allow short-settle paths for non-SPA minimal pages.
|
|
345
348
|
const pollInterval = 500; // Check every 500ms
|
|
346
349
|
const stableTime = 1000; // Content must be stable for 1 second
|
|
347
350
|
|