Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

chore: don't reuse recorder app profile (#5365)

Pavel Feldman6680713e845f
diff --git a/src/server/browserType.ts b/src/server/browserType.ts
index 0056074326..e2149141d7 100644
--- a/src/server/browserType.ts
+++ b/src/server/browserType.ts
@@ -71,7 +71,7 @@ export abstract class BrowserType {
return browser;
}
- async launchPersistentContext(userDataDir: string, options: types.LaunchPersistentOptions = {}): Promise<BrowserContext> {
+ async launchPersistentContext(userDataDir?: string, options: types.LaunchPersistentOptions = {}): Promise<BrowserContext> {
options = validateLaunchOptions(options);
const persistent: types.BrowserContextOptions = options;
const controller = new ProgressController();
diff --git a/src/server/chromium/chromium.ts b/src/server/chromium/chromium.ts
index a0a9a043b2..439ea37f7a 100644
--- a/src/server/chromium/chromium.ts
+++ b/src/server/chromium/chromium.ts
@@ -127,7 +127,7 @@ export class Chromium extends BrowserType {
}
}
-export const DEFAULT_ARGS = [
+const DEFAULT_ARGS = [
'--disable-background-networking',
'--enable-features=NetworkService,NetworkServiceInProcess',
'--disable-background-timer-throttling',
diff --git a/src/server/supplements/recorder/recorderApp.ts b/src/server/supplements/recorder/recorderApp.ts
index df3a8d3934..6fde54ed43 100644
--- a/src/server/supplements/recorder/recorderApp.ts
+++ b/src/server/supplements/recorder/recorderApp.ts
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-import * as os from 'os';
import * as fs from 'fs';
import * as path from 'path';
import * as util from 'util';
@@ -23,7 +22,6 @@ import { Page } from '../../page';
import { ProgressController } from '../../progress';
import { createPlaywright } from '../../playwright';
import { EventEmitter } from 'events';
-import { DEFAULT_ARGS } from '../../chromium/chromium';
const readFileAsync = util.promisify(fs.readFile);
@@ -92,15 +90,10 @@ export class RecorderApp extends EventEmitter {
static async open(): Promise<RecorderApp> {
const recorderPlaywright = createPlaywright(true);
- const context = await recorderPlaywright.chromium.launchPersistentContext('', {
- ignoreAllDefaultArgs: true,
+ const context = await recorderPlaywright.chromium.launchPersistentContext(undefined, {
args: [
- ...DEFAULT_ARGS,
- `--user-data-dir=${path.join(os.homedir(),'.playwright-app')}`,
- '--remote-debugging-pipe',
'--app=data:text/html,',
'--window-size=300,800',
- '--no-sandbox',
],
noDefaultViewport: true
});