chore: don't reuse recorder app profile (#5365)
This commit is contained in:
parent
b32be4b3d4
commit
6680713e84
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue