d8796531ee
- 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
12 lines
390 B
JavaScript
12 lines
390 B
JavaScript
const browser = require('../browser');
|
|
|
|
module.exports = async function({ selector = 'body' }) {
|
|
const p = await browser.ensurePage();
|
|
const text = await p.evaluate(function(s) {
|
|
var el = document.querySelector(s);
|
|
if (!el) return null;
|
|
return (el.innerText || el.textContent || '').trim();
|
|
}, selector);
|
|
return { success: true, action: 'get_text', selector, text };
|
|
};
|