Skip to content

Commit bf62cce

Browse files
motiz88meta-codesync[bot]
authored andcommitted
Accept --remote-debugging-port (#58905)
Summary: Pull Request resolved: #58905 Launching the React Native DevTools shell with Electron's standard `--remote-debugging-port=<port>` switch, for example to drive it from an end-to-end test over the Chrome DevTools Protocol, opens the port but then fails to open any window. Chromium consumes the switch at startup, but the shell's own launch-argument parsing is strict and rejects it as an unknown option, so the window for `--frontendUrl` is never created and the main process logs an unhandled rejection. Here, the launch-argument parser accepts `--remote-debugging-port` and ignores it. Chromium still acts on it, so the shell can be automated the same way as any Electron app, with no shell-specific environment variable or wrapper. Every other unknown option is still rejected. Changelog: [Internal] Differential Revision: D123603419 fbshipit-source-id: 8453352d1eb96b362ac07c23f491bcab12d8eb6e
1 parent 73f4204 commit bf62cce

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎packages/debugger-shell/src/electron/MainInstanceEntryPoint.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ function handleLaunchArgs(argv: string[]) {
3636
windowKey: {
3737
type: 'string',
3838
},
39+
// Consumed by Chromium at startup (exposes the Chrome DevTools Protocol
40+
// for automation); accepted here so that strict parsing doesn't reject it.
41+
'remote-debugging-port': {
42+
type: 'string',
43+
},
3944
},
4045
args: argv,
4146
});

0 commit comments

Comments
 (0)