feat: MCP Browser v3.0 - 42 tools with stealth mode, multi-tab, PDF, cookies, storage, network logs, device emulation
This commit is contained in:
+9
-26
@@ -2,31 +2,14 @@ const browser = require('../browser');
|
||||
|
||||
module.exports = async () => {
|
||||
await browser.start();
|
||||
const p = await browser.ensurePage();
|
||||
|
||||
const forms = await p.evaluate(() => {
|
||||
const formElements = Array.from(document.querySelectorAll('form'));
|
||||
|
||||
return formElements.map(form => {
|
||||
const inputs = Array.from(form.querySelectorAll('input, textarea, select'));
|
||||
|
||||
return {
|
||||
action: form.action || null,
|
||||
method: form.method || 'GET',
|
||||
fields: inputs.map(input => ({
|
||||
name: input.name || null,
|
||||
type: input.type || input.tagName.toLowerCase(),
|
||||
placeholder: input.placeholder || '',
|
||||
id: input.id || null
|
||||
}))
|
||||
};
|
||||
});
|
||||
const forms = await browser.evaluateJS(() => {
|
||||
return Array.from(document.querySelectorAll('form')).map(form => ({
|
||||
action: form.action || null,
|
||||
method: form.method || 'GET',
|
||||
fields: Array.from(form.querySelectorAll('input, textarea, select')).map(input => ({
|
||||
name: input.name || null, type: input.type || input.tagName.toLowerCase(), placeholder: input.placeholder || '', id: input.id || null
|
||||
}))
|
||||
}));
|
||||
});
|
||||
|
||||
return {
|
||||
success: true,
|
||||
action: "get_forms",
|
||||
count: forms.length,
|
||||
forms
|
||||
};
|
||||
return { success: true, action: 'get_forms', count: forms.length, forms };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user