gpt_chrome_autodrafter_v3/capture-logs.js
2025-07-01 15:46:34 -07:00

18 lines
No EOL
597 B
JavaScript

// capture-logs.js
module.exports = async ({ page, browser }) => {
// Listen for all console messages from the page
page.on('console', msg => {
console.log(`[PAGE LOG] ${msg.type()}: ${msg.text()}`);
});
// Open Gmail (or your extension's test page)
await page.goto('https://mail.google.com', { waitUntil: 'networkidle2' });
// Wait for a while so your extension can load and run
await page.waitForTimeout(10000); // 10 seconds
// Optionally, interact with the page or extension here
// Close the browser after capturing logs
await browser.close();
};