Skip to content

Commit ceb270b

Browse files
committed
Trying to fix #1688 popup
1 parent a32c2c4 commit ceb270b

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

webdriver-ts/Preferences

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"in_product_help": {
3+
"new_badge": {
4+
"ComposeNudge": {
5+
"feature_enabled_time": "13361198032433980",
6+
"show_count": 0,
7+
"used_count": 0
8+
}
9+
},
10+
"snoozed_feature": {
11+
"IPH_SidePanelGenericMenuFeature": {
12+
"first_show_time": "13361198032636854",
13+
"is_dismissed": true,
14+
"last_dismissed_by": 3,
15+
"last_show_time": "13361198032636854",
16+
"last_snooze_time": "0",
17+
"show_count": 1,
18+
"shown_for_apps": [],
19+
"snooze_count": 0
20+
}
21+
}
22+
}
23+
}
24+

webdriver-ts/src/puppeteerAccess.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import * as puppeteer from "puppeteer-core";
22
import { Page } from "puppeteer-core";
33
import { BenchmarkOptions, wait } from "./common.js";
4+
import * as fs from "node:fs";
5+
import * as path from "node:path";
46

57
export async function checkElementNotExists(page: Page, selector: string) {
68
let start = Date.now();
@@ -109,16 +111,27 @@ export async function startBrowser(benchmarkOptions: BenchmarkOptions): Promise<
109111
const window_width = width,
110112
window_height = height;
111113

114+
// delete the folder './chrome_profile' if it exists
115+
const dir = "chrome_profile";
116+
if (fs.existsSync(dir)) {
117+
fs.rmSync(dir, { recursive: true });
118+
}
119+
fs.mkdirSync(dir);
120+
fs.mkdirSync(path.join(dir,"Default"));
121+
fs.copyFileSync("Preferences", path.join(dir, "Default","Preferences"));
122+
112123
const args = [
113124
`--window-size=${window_width},${window_height}`,
114125
"--js-flags=--expose-gc", // needed for gc() function
115126
"--no-default-browser-check",
116127
"--disable-sync",
117128
"--disable-first-run-ui", // avoid popup "you can open bookmarks ..."
118-
"--no-first-run",
129+
"--no-first-run",
130+
"--ash-no-nudges",
119131
"--disable-extensions",
120132
"--disable-features=Translate", // avoid translation popups
121133
"--disable-features=PrivacySandboxSettings4", // avoid privacy popup
134+
"--user-data-dir=./chrome_profile"
122135
];
123136
if (benchmarkOptions.headless) args.push("--headless=new");
124137

0 commit comments

Comments
 (0)