Skip to content

Commit 5df6a4e

Browse files
authored
Revert "fix(electron): pass port via switches not args" (microsoft#39710)
1 parent 506b09b commit 5df6a4e

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

packages/playwright-core/src/server/electron/electron.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@ export class Electron extends SdkObject {
156156

157157
async launch(progress: Progress, options: Omit<channels.ElectronLaunchParams, 'timeout'>): Promise<ElectronApplication> {
158158
let app: ElectronApplication | undefined = undefined;
159-
// --inspect=0 must be the last playwright's argument, loader.ts relies on it.
160-
let electronArguments = ['--inspect=0', ...(options.args || [])];
159+
// --remote-debugging-port=0 must be the last playwright's argument, loader.ts relies on it.
160+
let electronArguments = ['--inspect=0', '--remote-debugging-port=0', ...(options.args || [])];
161161

162162
if (os.platform() === 'linux') {
163163
if (!options.chromiumSandbox && electronArguments.indexOf('--no-sandbox') === -1)

packages/playwright-core/src/server/electron/loader.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ const { chromiumSwitches } = require('../chromium/chromiumSwitches');
2121
// Always pass user arguments first, see https://github.com/microsoft/playwright/issues/16614 and
2222
// https://github.com/microsoft/playwright/issues/29198.
2323
// [Electron, -r, loader.js[, --no-sandbox>], --inspect=0, --remote-debugging-port=0, ...args]
24-
process.argv.splice(1, process.argv.indexOf('--inspect=0'));
25-
26-
app.commandLine.appendSwitch('remote-debugging-port', '0');
24+
process.argv.splice(1, process.argv.indexOf('--remote-debugging-port=0'));
2725

2826
for (const arg of chromiumSwitches()) {
2927
const match = arg.match(/--([^=]*)=?(.*)/)!;

0 commit comments

Comments
 (0)