Reputation: 21
I am trying to create a Playwright suite with typescript. But my code access client environment. Any borwser opened in that environment , gives a message to trust the browser. Only after clicking OK in that , I can proceed. Does Playwright support this feature ot trusting browsers? like selenium had "Options" for chorme.
Upvotes: 0
Views: 207
Reputation: 171
Yes, u can pass browser arguments into the Projects or browser config inside playwright config file. something like this.
{
name: "chrome",
use: {
...devices["Desktop Chrome"],
channel: "chrome",
headless: false,
launchOptions: {
args: [
"--disable-notifications",
"--disable-gpu",
"--ignore-certificate-errors",
"--disable-extensions",
"--no-sandbox",
"--disable-dev-shm-usage",
],
},
you can refer these,
List of common switches : /master/chrome/common/chrome_switches.cc
List of headless switches : /master/headless/app/headless_shell_switches.cc
To search other switches : https://source.chromium.org/search?q=file:switches.cc&ss=chromium%2Fchromium%2Fsrc
List of preferences: /master/chrome/common/pref_names.cc
or
https://peter.sh/experiments/chromium-command-line-switches/
Upvotes: 0