Setting specific chrome flags in puppeteer (enable and disable)

前端 未结 3 1679
栀梦
栀梦 2021-01-12 08:24

I\'m trying to add specific flags of chrome (flags that are found in \"chrome://flags/\") to the running of my browser in the tests.

The flags I\'m trying to enable

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-12 09:04

    await puppeteer.launch({
          args: [
            '--disable-features=LookalikeUrlNavigationSuggestionsUI'
          ]
    })
    

    Try something like this.

    You can launch Chromium, switch your flag and then go "chrome://version/", to see what has changed in the command line.

    In my case, when i switch "Navigation suggestions for lookalike URLs" to disabled,relaunch Chrommium, then i found --disable-features=LookalikeUrlNavigationSuggestionsUI in the command line。

提交回复
热议问题