/** * Basic test for background window functionality * Quick verification that 1280x720 background windows work correctly */ const MCP_HTTP_URL = 'http://localhost:3001/mcp'; async function testBasicBackgroundWindow() { console.log('๐Ÿงช Basic Background Window Test'); console.log('==============================='); try { console.log('1๏ธโƒฃ Testing basic background window creation...'); const response = await fetch(MCP_HTTP_URL, { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json, text/event-stream', }, body: JSON.stringify({ jsonrpc: '2.0', id: 1, method: 'tools/call', params: { name: 'chrome_navigate', arguments: { url: 'https://example.com', backgroundPage: true, }, }, }), }); const result = await response.json(); if (result.error) { console.log(`โŒ Error: ${result.error.message}`); return; } if (result.result && result.result.content) { const content = JSON.parse(result.result.content[0].text); console.log('โœ… Background window created successfully!'); console.log(`๐Ÿ“Š Window Details:`); console.log(` Window ID: ${content.windowId}`); console.log(` Dimensions: ${content.width}x${content.height}`); console.log(` URL: ${content.tabs?.[0]?.url || 'N/A'}`); console.log(` Automation Ready: ${content.automationReady}`); console.log(` Minimized: ${content.minimized}`); // Verify expected dimensions if (content.width === 1280 && content.height === 720) { console.log('โœ… Dimensions are correct (1280x720)'); } else { console.log( `โŒ Dimensions are incorrect. Expected 1280x720, got ${content.width}x${content.height}`, ); } console.log('\nโณ Window should now be minimized in your taskbar.'); console.log(' You can click on it to see the page loaded at example.com'); } else { console.log('โŒ Unexpected response format'); console.log('Raw response:', JSON.stringify(result, null, 2)); } } catch (error) { console.log(`โŒ Test failed: ${error.message}`); console.log('Make sure the MCP server is running on localhost:3001'); } } // Run the basic test testBasicBackgroundWindow().catch(console.error);