Skip to content

Commit

Permalink
chore: don't reuse recorder app profile (#5365)
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelfeldman committed Feb 9, 2021
1 parent b32be4b commit 6680713
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/server/browserType.ts
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/server/chromium/chromium.ts
Expand Up @@ -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',
Expand Down
9 changes: 1 addition & 8 deletions src/server/supplements/recorder/recorderApp.ts
Expand Up @@ -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';
Expand All @@ -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);

Expand Down Expand Up @@ -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
});
Expand Down

0 comments on commit 6680713

Please sign in to comment.