mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +03:00
fix: pass sdkLanguage to service server (#26702)
This commit is contained in:
parent
77f4f4d5de
commit
70dcaabdee
@ -16,6 +16,7 @@
|
||||
|
||||
import type { WebSocket } from '../utilsBundle';
|
||||
import type { DispatcherScope, Playwright } from '../server';
|
||||
import type * as channels from '@protocol/channels';
|
||||
import { createPlaywright, DispatcherConnection, RootDispatcher, PlaywrightDispatcher } from '../server';
|
||||
import { Browser } from '../server/browser';
|
||||
import { serverSideCallMetadata } from '../server/instrumentation';
|
||||
@ -94,21 +95,21 @@ export class PlaywrightConnection {
|
||||
return;
|
||||
}
|
||||
|
||||
this._root = new RootDispatcher(this._dispatcherConnection, async scope => {
|
||||
this._root = new RootDispatcher(this._dispatcherConnection, async (scope, options) => {
|
||||
await startProfiling();
|
||||
if (clientType === 'reuse-browser')
|
||||
return await this._initReuseBrowsersMode(scope);
|
||||
if (clientType === 'pre-launched-browser-or-android')
|
||||
return this._preLaunched.browser ? await this._initPreLaunchedBrowserMode(scope) : await this._initPreLaunchedAndroidMode(scope);
|
||||
if (clientType === 'launch-browser')
|
||||
return await this._initLaunchBrowserMode(scope);
|
||||
return await this._initLaunchBrowserMode(scope, options);
|
||||
throw new Error('Unsupported client type: ' + clientType);
|
||||
});
|
||||
}
|
||||
|
||||
private async _initLaunchBrowserMode(scope: RootDispatcher) {
|
||||
private async _initLaunchBrowserMode(scope: RootDispatcher, options: channels.RootInitializeParams) {
|
||||
debugLogger.log('server', `[${this._id}] engaged launch mode for "${this._options.browserName}"`);
|
||||
const playwright = createPlaywright({ sdkLanguage: 'javascript', isServer: true });
|
||||
const playwright = createPlaywright({ sdkLanguage: options.sdkLanguage, isServer: true });
|
||||
|
||||
const ownedSocksProxy = await this._createOwnedSocksProxy(playwright);
|
||||
const browser = await playwright[this._options.browserName as 'chromium'].launch(serverSideCallMetadata(), this._options.launchOptions);
|
||||
|
Loading…
Reference in New Issue
Block a user