Files
MCP-Browser/tools/switchTab.js
T

11 lines
361 B
JavaScript

const browser = require('../browser');
module.exports = async ({ index }) => {
if (index === undefined) throw new Error('Index é obrigatório');
await browser.start();
await browser.switchTab(index);
const url = await browser.currentUrl();
const title = await browser.title();
return { success: true, action: 'switch_tab', index, url, title };
};