feat(baoyu-danger-x-to-markdown): WSL auto-detection and debug port env var

Add X_DEBUG_PORT env var for fixed port in WSL.
Auto-detect WSL and resolve Chrome profile to Windows-native path.
This commit is contained in:
Jim Liu 宝玉
2026-03-02 12:07:16 -06:00
parent e3f00c103e
commit e2a15aadcc
2 changed files with 16 additions and 0 deletions
@@ -117,6 +117,8 @@ class CdpConnection {
}
async function getFreePort(): Promise<number> {
const fixed = parseInt(process.env.X_DEBUG_PORT || "", 10);
if (fixed > 0) return fixed;
return await new Promise((resolve, reject) => {
const srv = net.createServer();
srv.unref();