feat: MCP Browser v3.0 - 42 tools with stealth mode, multi-tab, PDF, cookies, storage, network logs, device emulation
This commit is contained in:
+3
-13
@@ -2,20 +2,10 @@ const browser = require('../browser');
|
||||
|
||||
module.exports = async ({ selector = 'body' }) => {
|
||||
await browser.start();
|
||||
const p = await browser.ensurePage();
|
||||
|
||||
const text = await p.evaluate((sel) => {
|
||||
const text = await browser.evaluateJS((sel) => {
|
||||
const el = document.querySelector(sel);
|
||||
if (!el) return null;
|
||||
|
||||
const t = el.innerText || el.textContent || '';
|
||||
return t.trim() || null;
|
||||
return (el.innerText || el.textContent || '').trim();
|
||||
}, selector);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
action: "get_text",
|
||||
selector,
|
||||
text
|
||||
};
|
||||
return { success: true, action: 'get_text', selector, text };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user