我指的是弹出窗口:

有没有办法防止铬显示这些弹出窗口?我试过使用--user-data-dir。
下面是我使用的所有标志:
const chromeSwitches = [
`--user-data-dir=${tasksDataDirPath+'\\'+taskName}`,
`--remote-debugging-port=${availablePort}`,
"--arc-disable-locale-sync",
"--disable-features=IsolateOrigins,site-per-process",
"--disable-component-extensions-with-background-pages",
"--disable-background-timer-throttling",
"--disable-backgrounding-occluded-windows",
"--disable-renderer-backgrounding",
"--no-first-run",
"--password-store=basic",
"--use-mock-keychain",
"--disable-extensions",
"--disable-default-apps",
"--disable-features=Translate",
"--disable-background-networking",
"--disable-sync",
"--metrics-recording-only",
"--mute-audio",
"--no-default-browser-check",
"--enable-remote-debugging"
];发布于 2022-07-24 19:05:35
在查看Chrome之前,只需手动/以编程方式删除此文件即可。
在Windows上:C:\Users\<username>\AppData\Local\Google\Chrome\User Data\Default\Preferences
Linux上:/home/<username>/.config/google-chrome/default/Preferences
关于MacOS:Users/<username>/Library/Application Support/Google/Chrome/Default/Preferences
https://stackoverflow.com/questions/69791724
复制相似问题