feat: MCP Browser v3.0 - 42 tools with stealth mode, multi-tab, PDF, cookies, storage, network logs, device emulation
This commit is contained in:
+4
-16
@@ -1,20 +1,8 @@
|
||||
const browser = require('../browser');
|
||||
|
||||
module.exports = async ({ selector, text }) => {
|
||||
if (!selector || !text) {
|
||||
throw new Error('Selector e text são obrigatórios');
|
||||
}
|
||||
|
||||
module.exports = async ({ selector, text, clear = false, slowly = false }) => {
|
||||
if (!selector || !text) throw new Error('Selector e text são obrigatórios');
|
||||
await browser.start();
|
||||
const p = await browser.ensurePage();
|
||||
|
||||
await p.waitForSelector(selector, { state: 'visible', timeout: 10000 });
|
||||
await p.fill(selector, text);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
action: "type",
|
||||
selector,
|
||||
text
|
||||
};
|
||||
await browser.type(selector, text, { clear, slowly });
|
||||
return { success: true, action: 'type', selector, text, clear, slowly };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user