feat: MCP Browser - servidor MCP para automação de navegador com Playwright
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const browser = require('../browser');
|
||||
|
||||
module.exports = async ({ selector, text }) => {
|
||||
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
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user