feat: MCP Browser v3.0 - 42 tools with stealth mode, multi-tab, PDF, cookies, storage, network logs, device emulation
This commit is contained in:
@@ -2,25 +2,9 @@ const browser = require('../browser');
|
||||
|
||||
module.exports = async ({ timeout = 15000 }) => {
|
||||
await browser.start();
|
||||
const oldUrl = await browser.currentUrl();
|
||||
const p = await browser.ensurePage();
|
||||
|
||||
const oldUrl = p.url();
|
||||
|
||||
try {
|
||||
await Promise.race([
|
||||
p.waitForNavigation({ timeout, waitUntil: 'domcontentloaded' }),
|
||||
p.waitForLoadState('domcontentloaded', { timeout })
|
||||
]);
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
const newUrl = p.url();
|
||||
|
||||
return {
|
||||
success: true,
|
||||
action: "smart_wait_navigation",
|
||||
oldUrl,
|
||||
newUrl,
|
||||
changed: oldUrl !== newUrl
|
||||
};
|
||||
try { await Promise.race([p.waitForNavigation({ timeout, waitUntil: 'domcontentloaded' }), p.waitForLoadState('domcontentloaded', { timeout })]); } catch (e) {}
|
||||
const newUrl = await browser.currentUrl();
|
||||
return { success: true, action: 'smart_wait_navigation', oldUrl, newUrl, changed: oldUrl !== newUrl };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user