feat: MCP Browser v3.0 - 42 tools with stealth mode, multi-tab, PDF, cookies, storage, network logs, device emulation
This commit is contained in:
@@ -1,22 +1,9 @@
|
||||
const browser = require('../browser');
|
||||
|
||||
module.exports = async ({ selector, timeout = 15000 }) => {
|
||||
if (!selector) {
|
||||
throw new Error('Selector é obrigatório');
|
||||
}
|
||||
|
||||
module.exports = async ({ selector, timeout = 15000, state = 'attached' }) => {
|
||||
if (!selector) throw new Error('Selector é obrigatório');
|
||||
await browser.start();
|
||||
const p = await browser.ensurePage();
|
||||
|
||||
const el = await p.waitForSelector(selector, {
|
||||
timeout,
|
||||
state: 'attached'
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
action: "wait_for_selector",
|
||||
selector,
|
||||
found: !!el
|
||||
};
|
||||
const el = await p.waitForSelector(selector, { timeout, state });
|
||||
return { success: true, action: 'wait_for_selector', selector, found: !!el };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user