- Added 9 new tools: visual overlay, highlight, toast, drag-drop, etc. - Fixed evaluateJS to support function arguments - Fixed hover for non-visible elements - Fixed storage operations with try/catch - Added 10 new wait tools: clickable, element visible, text - Fixed tool name mapping in server.js for MCP protocol - Updated README with 60+ tools documentation - Version bump to 3.1.1
15 lines
484 B
JavaScript
15 lines
484 B
JavaScript
const browser = require('../browser');
|
|
|
|
module.exports = async ({ expression, selector = null }) => {
|
|
if (!expression) throw new Error('Expression é obrigatória');
|
|
await browser.start();
|
|
|
|
if (selector) {
|
|
const result = await browser.evaluateOnSelector(selector, expression);
|
|
return { success: true, action: 'evaluate_js', selector, result };
|
|
}
|
|
|
|
const result = await browser.evaluateJS(expression);
|
|
return { success: true, action: 'evaluate_js', result };
|
|
};
|