Skip to content

Commit

Permalink
fix(webdriver): throw an error on pipe provided for Firefox (#12934)
Browse files Browse the repository at this point in the history
  • Loading branch information
OrKoN authored Aug 12, 2024
1 parent 14717a7 commit bec089c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/api/puppeteer.launchoptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ boolean

</td><td>

Connect to a browser over a pipe instead of a WebSocket.
Connect to a browser over a pipe instead of a WebSocket. Only supported with Chrome.

</td><td>

Expand Down
10 changes: 10 additions & 0 deletions packages/puppeteer-core/src/node/BrowserLauncher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ export abstract class BrowserLauncher {
);
}

if (
this.#browser === 'firefox' &&
protocol === 'webDriverBiDi' &&
usePipe
) {
throw new Error(
'Pipe connections are not supported wtih Firefox and WebDriver BiDi'
);
}

const browserProcess = launch({
executablePath: launchArgs.executablePath,
args: launchArgs.args,
Expand Down
4 changes: 3 additions & 1 deletion packages/puppeteer-core/src/node/LaunchOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ export interface LaunchOptions {
*/
env?: Record<string, string | undefined>;
/**
* Connect to a browser over a pipe instead of a WebSocket.
* Connect to a browser over a pipe instead of a WebSocket. Only supported
* with Chrome.
*
* @defaultValue `false`
*/
pipe?: boolean;
Expand Down

0 comments on commit bec089c

Please sign in to comment.