Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running with latest Chrome version #167

Open
ReneJBosch opened this issue Feb 6, 2022 · 22 comments
Open

Running with latest Chrome version #167

ReneJBosch opened this issue Feb 6, 2022 · 22 comments

Comments

@ReneJBosch
Copy link

Latest Chrome version no longer supports the "--disable-infobars" argument, so lorca now runs with the text "Chrome is being controlled by automated test software" in the info-bar.
To be fair ...It does not break the running of the program but it is annoying.
Argument should be replaced by an "enable-automation" Chrome option.

@pierrejoye
Copy link

While it should be added, in the meantime you can pass custom args to the New method:

func New(url, dir string, width, height int, customArgs ...string) (UI, error)

@ReneJBosch
Copy link
Author

Yes, I have seen that, but how? It is not just a matter of specifying something like "--enable-automation" because no such argument exists.
It appears to be a Chrome option called "excludeSwitches" which must be followed by an array of such switches, so in this case - as there's only one - by "[enable-automation]". I don't know how to specify that as a (custom) argument (provided you can)

@FrankFang
Copy link

I could not find a method to set "excludeSwitches" via Chrome's command-line arguments.

@pierrejoye
Copy link

Ah, it seems to be a flag, experimental, the New method does not allow to pass flags. The chrome instance object must have the methods to enable/disable flags, I did not check yet.

@FrankFang
Copy link

Any ideas?

@gg3083
Copy link

gg3083 commented Feb 17, 2022

hi guys, Has good idea?

@bin16
Copy link

bin16 commented Feb 19, 2022

Can you guys check this: https://peter.sh/experiments/chromium-command-line-switches/#enable-automation

--enable-automation | Enable indication that browser is controlled by automation.

It looks that the --enable-automation flag is used to show that message "Chrome is controlled by...", removing it from defaultChromeArgs in ui.go may help.

lorca/ui.go

Line 52 in 1006348

"--enable-automation",

@bin16
Copy link

bin16 commented Feb 19, 2022

Tiny demo, no message bar and no shadow:

image

package main

import (
	"os/exec"
)

func main() {
	browser := "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
	args := []string{
		"--no-first-run",
		// "--enable-automation",
		"--app=data:text/html, <h1>hello!</h1>",
		"--window-size=300,200",
		"--remote-debugging-port=0",
		"--user-data-dir=./a/",
	}
	cmd := exec.Command(browser, args...)
	cmd.Start()
}

May be you should clear the user data dir at first.

@gg3083
Copy link

gg3083 commented Feb 21, 2022

Can you guys check this: https://peter.sh/experiments/chromium-command-line-switches/#enable-automation

--enable-automation | Enable indication that browser is controlled by automation.

It looks that the --enable-automation flag is used to show that message "Chrome is controlled by...", removing it from defaultChromeArgs in ui.go may help.

lorca/ui.go

Line 52 in 1006348

"--enable-automation",

it`s work

@cgostuff
Copy link

Can you guys check this: https://peter.sh/experiments/chromium-command-line-switches/#enable-automation

--enable-automation | Enable indication that browser is controlled by automation.

It looks that the --enable-automation flag is used to show that message "Chrome is controlled by...", removing it from defaultChromeArgs in ui.go may help.

lorca/ui.go

Line 52 in 1006348

"--enable-automation",

it`s work

Doesn't work for me. Did you have to delete some cached data? I pass an empty string to lorca.New dir parameter, so the user data should be deleted already in my case.

@gg3083
Copy link

gg3083 commented Feb 21, 2022

Can you guys check this: https://peter.sh/experiments/chromium-command-line-switches/#enable-automation

--enable-automation | Enable indication that browser is controlled by automation.

It looks that the --enable-automation flag is used to show that message "Chrome is controlled by...", removing it from defaultChromeArgs in ui.go may help.

lorca/ui.go

Line 52 in 1006348

"--enable-automation",

it`s work

Doesn't work for me. Did you have to delete some cached data? I pass an empty string to lorca.New dir parameter, so the user data should be deleted already in my case.

I only modified the source code 'defaultChromeArgs' .
(ui.go 52 line) // '--enable-automation'

@cgostuff
Copy link

Can you guys check this: https://peter.sh/experiments/chromium-command-line-switches/#enable-automation

--enable-automation | Enable indication that browser is controlled by automation.

It looks that the --enable-automation flag is used to show that message "Chrome is controlled by...", removing it from defaultChromeArgs in ui.go may help.

lorca/ui.go

Line 52 in 1006348

"--enable-automation",

it`s work

Doesn't work for me. Did you have to delete some cached data? I pass an empty string to lorca.New dir parameter, so the user data should be deleted already in my case.

I only modified the source code 'defaultChromeArgs' . (ui.go 52 line) // '--enable-automation'

Strange, I do the same, and "Chrome is being controlled by automated test software" is still shown.

@gg3083
Copy link

gg3083 commented Feb 21, 2022

Can you guys check this: https://peter.sh/experiments/chromium-command-line-switches/#enable-automation

--enable-automation | Enable indication that browser is controlled by automation.

It looks that the --enable-automation flag is used to show that message "Chrome is controlled by...", removing it from defaultChromeArgs in ui.go may help.

lorca/ui.go

Line 52 in 1006348

"--enable-automation",

it`s work

Doesn't work for me. Did you have to delete some cached data? I pass an empty string to lorca.New dir parameter, so the user data should be deleted already in my case.

I only modified the source code 'defaultChromeArgs' . (ui.go 52 line) // '--enable-automation'

Strange, I do the same, and "Chrome is being controlled by automated test software" is still shown.

my code

ui, err := lorca.New("", "", 1366, 768, []string{})

@cgostuff
Copy link

Can you guys check this: https://peter.sh/experiments/chromium-command-line-switches/#enable-automation

--enable-automation | Enable indication that browser is controlled by automation.

It looks that the --enable-automation flag is used to show that message "Chrome is controlled by...", removing it from defaultChromeArgs in ui.go may help.

lorca/ui.go

Line 52 in 1006348

"--enable-automation",

it`s work

Doesn't work for me. Did you have to delete some cached data? I pass an empty string to lorca.New dir parameter, so the user data should be deleted already in my case.

I only modified the source code 'defaultChromeArgs' . (ui.go 52 line) // '--enable-automation'

Strange, I do the same, and "Chrome is being controlled by automated test software" is still shown.

my code

ui, err := lorca.New("", "", 1366, 768, []string{})

Thanks, now it does work for me too. The issue for me was that the source code was in read-only mode.

@cgostuff
Copy link

cgostuff commented Feb 23, 2022

Actually, I've found that removing the "--enable-automation" flag alone is not a great fix. This causes the "save password" bubble to pop up whenever you use lorca to log in somewhere.

This comment explains the side effects of disabling automation: puppeteer/puppeteer#2070 (comment)

The flag "--disable-save-password-bubble" has apparently also been removed a while back. It seems they have made it very difficult to hide both the password bubble and the automation infobar at the same time.

@aviscaerulea
Copy link

aviscaerulea commented Mar 14, 2022

I am also having the same problem.
When I run the code from #167 (comment) the info bar does not show up. However, removing --enable-automation from github.com/zserge/lorca/ui.go in vendor does not hide the info bar.

Deleting Chrome's cache and temporary files did not change the result.

Is there a temporary way to address this issue?

Environments :
Chromium 98.0.4758.106 Built on Debian , running on Debian 11 (on Raspberry Pi 3 aarch64)

@cgostuff
Copy link

cgostuff commented Mar 31, 2022

Has anyone had any luck removing both the infobar and the save password prompt at the same time?

On a somewhat related note, I have been able to disable the google translate UI by passing an experimental flag into New() like this: "--disable-features=Translate". Can we perhaps leverage the "--disable-features=x" argument to solve the issue?

Based on some additional research, it seems that the CommandLineFlagSecurityWarningsEnabled policy can actually control the infobar on newer chrome versions, like disable-infobars used to.

@Bellisario
Copy link

Any solution? I'm having the same problem...

@buildnewapp
Copy link

modify lorca/ui.go:
remove "--enable-automation",

	"--no-default-browser-check",
	"--safebrowsing-disable-auto-update",
	//"--enable-automation",
	"--password-store=basic",
	"--use-mock-keychain",

it's ok for me, chrome v103 with mac

@prospero78
Copy link

prospero78 commented Nov 28, 2022

modify lorca/ui.go:
remove "--enable-automation",

Two tea for this sir!

@tooolbox
Copy link

Removing the "--enable-automation" flag from ui.go did solve the problem for me, although I'm concerned about Lorca popping up Save Password dialogs. Ideally this gets a solution which doesn't break something else.

@dcboy
Copy link

dcboy commented Sep 15, 2023

use this args --disable-features=automation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests