Files
MCP-Browser/tools/screenshot.js
T

17 lines
326 B
JavaScript

const browser = require('../browser');
module.exports = async ({ fullPage = true }) => {
await browser.start();
const p = await browser.ensurePage();
const path = `screenshot-${Date.now()}.png`;
await p.screenshot({ path, fullPage });
return {
success: true,
action: "screenshot",
file: path
};
};