Initial commit: StudyOS platform
This commit is contained in:
16
cdp-test.js
Normal file
16
cdp-test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
const http = require('http');
|
||||
|
||||
// Get page from CDP
|
||||
http.get('http://localhost:9222/json', (res) => {
|
||||
let data = '';
|
||||
res.on('data', d => data += d);
|
||||
res.on('end', () => {
|
||||
const pages = JSON.parse(data);
|
||||
const page = pages.find(p => p.url.includes('localhost:3001'));
|
||||
if (!page) { console.log('StudyOS page not found. Open pages:', pages.map(p => p.url)); return; }
|
||||
console.log('Page found:', page.url);
|
||||
console.log('DevTools URL:', page.devtoolsFrontendUrl);
|
||||
console.log('Title:', page.title);
|
||||
console.log('Page ID:', page.id);
|
||||
});
|
||||
}).on('error', e => console.log('CDP error:', e.message));
|
||||
Reference in New Issue
Block a user