mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: followRedirects in PlaywrightClient (#11599)
This commit is contained in:
parent
136fab7041
commit
a5bc2efc18
@ -21,7 +21,8 @@ import { makeWaitForNextTask } from '../utils/utils';
|
||||
|
||||
export type PlaywrightClientConnectOptions = {
|
||||
wsEndpoint: string;
|
||||
timeout?: number
|
||||
timeout?: number;
|
||||
followRedirects?: boolean;
|
||||
};
|
||||
|
||||
export class PlaywrightClient {
|
||||
@ -30,10 +31,10 @@ export class PlaywrightClient {
|
||||
private _closePromise: Promise<void>;
|
||||
|
||||
static async connect(options: PlaywrightClientConnectOptions): Promise<PlaywrightClient> {
|
||||
const { wsEndpoint, timeout = 30000 } = options;
|
||||
const { wsEndpoint, timeout = 30000, followRedirects = true } = options;
|
||||
const connection = new Connection();
|
||||
connection.markAsRemote();
|
||||
const ws = new WebSocket(wsEndpoint);
|
||||
const ws = new WebSocket(wsEndpoint, { followRedirects });
|
||||
const waitForNextTask = makeWaitForNextTask();
|
||||
connection.onmessage = message => {
|
||||
if (ws.readyState === 2 /** CLOSING */ || ws.readyState === 3 /** CLOSED */)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user