Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

Commit

Permalink
fix(profiler): chrome unique datadir
Browse files Browse the repository at this point in the history
  • Loading branch information
soundofspace committed Jun 4, 2024
1 parent d9fd443 commit 106364d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
4 changes: 3 additions & 1 deletion browser-profiler/main/lib/local-tooling/ChromeUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export function getChromeDownloadUrlForLinux(fullVersion: string): string {
return `https://github.com/ulixee/chrome-versions/releases/download/${fullVersion}/chrome_${fullVersion}_linux.tar.gz`;
}

let counter = 0;
export async function startChromeAndLoadUrl(
executablePath: string,
url: string,
Expand All @@ -26,7 +27,8 @@ export async function startChromeAndLoadUrl(
'--no-default-browser-check',
'--no-first-run',
'--use-mock-keychain',
'--disable-features=MediaRouter,DialMediaRouteProvider' // remove chrome window prompt
'--disable-features=MediaRouter,DialMediaRouteProvider', // remove chrome window prompt
`--user-data-dir=/tmp/${Date.now()}-${(counter += 1)}`,
];
if (headType === 'headless') {
if (majorVersion >= 109) {
Expand Down
2 changes: 1 addition & 1 deletion browser-profiler/main/lib/local-tooling/DockerUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export async function startDockerAndLoadUrl(
'--shm-size="3gb"',
'--cap-add=SYS_ADMIN',
];
counter += 1;

const chromeArgs = [
'--allow-running-insecure-content',
'--ignore-certificate-errors',
Expand Down
6 changes: 3 additions & 3 deletions browser-profiler/main/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
"scripts": {
"downloadData": "node ../../build/browser-profiler/main/scripts/cloneData.js",
"cleanProfiles": "node -e 'require(\".../../build/browser-profiler/main/scripts/runBrowserstack.js\").cleanProfiles()'",
"profile:browserstack": "node -e 'require(\"../../build/browser-profiler/main/scripts/runBrowserstack.js\").default().catch(console.error)'",
"profile:dom-browserstack": "node -e 'require(\"../../build/browser-profiler/main/scripts/runBrowserstackDoms.js\").default()'",
"profile:dom-local": "node -e 'require(\"../../build/browser-profiler/main/scripts/runLocalDoms.js\").default()'"
"profile:browserstack": "node --inspect -e 'require(\"../../build/browser-profiler/main/scripts/runBrowserstack.js\").default().catch(console.error)'",
"profile:dom-browserstack": "node --inspect -e 'require(\"../../build/browser-profiler/main/scripts/runBrowserstackDoms.js\").default()'",
"profile:dom-local": "node --inspect -e 'require(\"../../build/browser-profiler/main/scripts/runLocalDoms.js\").default()'"
},
"dependencies": {
"@double-agent/collect": "2.0.0-alpha.28",
Expand Down

0 comments on commit 106364d

Please sign in to comment.