feat(observer): v8 full-DOM unconditional dump — body tree capture at 5s/15s/60s with depth 15, indexed dump files, deep-inspect overhaul #task-619
This commit is contained in:
@@ -126,9 +126,12 @@ export function startHttpBridge(ctx: HttpBridgeContext, sdk: any): Promise<numbe
|
||||
req.on('data', (c: string) => dumpBody += c);
|
||||
req.on('end', () => {
|
||||
try {
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
// Save indexed dump for history + latest as dump_html.json
|
||||
let idx = 1;
|
||||
try { const parsed = JSON.parse(dumpBody); idx = parsed.dumpIndex || idx; } catch {}
|
||||
fs.writeFileSync(path.join(ctx.bridgePath, `dump_html_${idx}.json`), dumpBody, 'utf-8');
|
||||
fs.writeFileSync(path.join(ctx.bridgePath, 'dump_html.json'), dumpBody, 'utf-8');
|
||||
ctx.logToFile(`[HTTP] DOM dump #${idx} saved (${dumpBody.length} bytes)`);
|
||||
} catch (e) { }
|
||||
res.writeHead(200); res.end('ok');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user