Skip to content

Commit fa58ef3

Browse files
chore: remove support for custom host parameter
1 parent 5f22a26 commit fa58ef3

5 files changed

Lines changed: 0 additions & 38 deletions

File tree

src/cli.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,6 @@ export const cliOptions = {
110110
description: 'Marionette port to connect to when using --connect-existing (default: 2828)',
111111
default: Number(process.env.MARIONETTE_PORT ?? '2828'),
112112
},
113-
marionetteHost: {
114-
type: 'string',
115-
description:
116-
'Marionette host to connect to when using --connect-existing (default: 127.0.0.1).' +
117-
' Also used as the BiDi WebSocket connect address when different from 127.0.0.1.',
118-
default: process.env.MARIONETTE_HOST ?? '127.0.0.1',
119-
},
120113
env: {
121114
type: 'array',
122115
description:

src/firefox/core.ts

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ export class FirefoxCore {
155155

156156
if (this.options.connectExisting) {
157157
const port = this.options.marionettePort ?? 2828;
158-
const host = this.options.marionetteHost ?? '127.0.0.1';
159158

160159
// Find geckodriver binary (--driver avoids downloading Firefox via selenium-manager)
161160
const geckodriverPath = await findGeckodriver();
@@ -180,20 +179,6 @@ export class FirefoxCore {
180179
// which would otherwise invoke selenium-manager with --browser firefox.
181180
const seleniumDriver = firefox.Driver.createSession(caps, serviceBuilder.build());
182181
this.driver = seleniumDriver as unknown as IDriver;
183-
184-
// For remote Firefox, rewrite webSocketUrl hostname in the session capabilities.
185-
// Selenium only rewrites localhost→127.0.0.1; arbitrary hosts need explicit patching.
186-
// Session.getCapabilities() returns the same Capabilities object every time, so
187-
// calling caps.set() here is seen by the lazy getBidi() call that comes later.
188-
if (host !== '127.0.0.1') {
189-
const caps = await seleniumDriver.getCapabilities();
190-
const wsUrl = caps.get('webSocketUrl') as string | undefined;
191-
if (wsUrl) {
192-
const parsed = new URL(wsUrl);
193-
parsed.hostname = host;
194-
caps.set('webSocketUrl', parsed.toString());
195-
}
196-
}
197182
} else {
198183
// Set up output file for capturing Firefox stdout/stderr
199184
if (this.options.logFile) {

src/firefox/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ export interface FirefoxLaunchOptions {
6060
acceptInsecureCerts?: boolean | undefined;
6161
connectExisting?: boolean | undefined;
6262
marionettePort?: number | undefined;
63-
marionetteHost?: string | undefined;
6463
env?: Record<string, string> | undefined;
6564
logFile?: string | undefined;
6665
/** Firefox preferences to set at startup via moz:firefoxOptions */

src/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ export async function getFirefox(): Promise<FirefoxDevTools> {
141141
acceptInsecureCerts: args.acceptInsecureCerts,
142142
connectExisting: args.connectExisting,
143143
marionettePort: args.marionettePort,
144-
marionetteHost: args.marionetteHost,
145144
env: envVars,
146145
logFile: args.outputFile ?? undefined,
147146
prefs,

tests/firefox/connect-existing.test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,6 @@
44

55
import { describe, it, expect, vi } from 'vitest';
66

7-
describe('FirefoxCore connect-existing with marionetteHost', () => {
8-
it('should pass marionetteHost to options', async () => {
9-
const { FirefoxCore } = await import('@/firefox/core.js');
10-
const core = new FirefoxCore({
11-
headless: true,
12-
connectExisting: true,
13-
marionettePort: 2828,
14-
marionetteHost: '192.168.1.100',
15-
});
16-
17-
expect(core.getOptions().marionetteHost).toBe('192.168.1.100');
18-
});
19-
});
20-
217
describe('getFirefox() reconnect behavior', () => {
228
it('should reconnect when connection is lost instead of throwing', async () => {
239
vi.resetModules();

0 commit comments

Comments
 (0)