Add Electron renderer remote debugging for profiling

This commit is contained in:
Mohamed Boudra
2026-05-13 22:13:47 +07:00
parent bc329a2d85
commit 7a0606952d
3 changed files with 23 additions and 0 deletions
+13
View File
@@ -15,6 +15,18 @@ $env:EXPO_PORT = (npx get-port-cli 8081 8082 8083 8084 8085).Trim()
# Set EXPO_DEV_URL in the environment so Electron inherits it
$env:EXPO_DEV_URL = "http://localhost:$($env:EXPO_PORT)"
$RemoteDebuggingPort = if ($env:PASEO_ELECTRON_REMOTE_DEBUGGING_PORT) {
$env:PASEO_ELECTRON_REMOTE_DEBUGGING_PORT
} else {
"9223"
}
$ExistingElectronFlags = if ($env:PASEO_ELECTRON_FLAGS) {
"$($env:PASEO_ELECTRON_FLAGS) "
} else {
""
}
$env:PASEO_ELECTRON_FLAGS = "$($ExistingElectronFlags)--remote-debugging-port=$RemoteDebuggingPort"
# Allow any origin in dev so Electron on random ports works.
# SECURITY: wildcard CORS is unsafe in production — only acceptable here because
# the daemon binds to localhost and this script is never used for production.
@@ -25,6 +37,7 @@ Write-Host @"
Paseo Desktop Dev (Windows)
======================================================
Metro: http://localhost:$($env:EXPO_PORT)
CDP: http://127.0.0.1:$RemoteDebuggingPort
======================================================
"@