Skip to content

Commit ba1e774

Browse files
committed
Merge pull request nwjs#2929 from ghostoy/devtools-persist
Set default port of devtools to 9222
2 parents fce15fa + 5190159 commit ba1e774

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/shell_browser_main_parts.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,16 +219,19 @@ void ShellBrowserMainParts::Init() {
219219

220220
net::NetModule::SetResourceProvider(PlatformResourceProvider);
221221

222-
int port = 0;
222+
// FIXME: This is a workaround to fix #2206 by setting default port to non-zero.
223+
// The real fix would be enabling chrome-devtools:// schema.
224+
int port = 9222;
223225
// See if the user specified a port on the command line (useful for
224226
// automation). If not, use an ephemeral port by specifying 0.
225227

226228
if (command_line.HasSwitch(switches::kRemoteDebuggingPort)) {
227229
int temp_port;
228230
std::string port_str =
229231
command_line.GetSwitchValueASCII(switches::kRemoteDebuggingPort);
232+
// FIXME: should revert to `temp_port > 0` when chrome-devtools:// is enabled
230233
if (base::StringToInt(port_str, &temp_port) &&
231-
temp_port > 0 && temp_port < 65535) {
234+
temp_port >= 0 && temp_port < 65535) {
232235
port = temp_port;
233236
} else {
234237
DLOG(WARNING) << "Invalid http debugger port number " << temp_port;

0 commit comments

Comments
 (0)