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

chromedp is not working when the browser is started with --app #1076

Closed
builuc1998 opened this issue Jun 2, 2022 · 5 comments · Fixed by #1077
Closed

chromedp is not working when the browser is started with --app #1076

builuc1998 opened this issue Jun 2, 2022 · 5 comments · Fixed by #1077

Comments

@builuc1998
Copy link

builuc1998 commented Jun 2, 2022

I am trying to use chromedp.Flag("app", "data://") but it is not working. cannot control chromedp. what should i do now?

opts := append(chromedp.DefaultExecAllocatorOptions[:],
		chromedp.Flag("headless", false),
		chromedp.Flag("app", "data://"),
		chromedp.WindowSize(200, 200),
	)
allocCtx, _ := chromedp.NewExecAllocator(context.TODO(), opts...)
ctx, _ := chromedp.NewContext(allocCtx, chromedp.WithLogf(log.Printf))
title := fmt.Sprintf("xinchao%d", i)
fmt.Println(title)
fmt.Println("============================")
chromedp.Run(ctx, chromedp.EvaluateAsDevTools(`alert()`, nil))

I tried removing chromedp.Flag("app", "data://") and it works fine

@ZekeLu
Copy link
Member

ZekeLu commented Jun 2, 2022

May I know your use case of the --app option? I'm not sure how complex will it be to make it support the --app flag, and I'm also not sure whether it‘s worth addressing this issue.

@ZekeLu ZekeLu changed the title Chromedp not working with Flag app chromedp is not working when the browser is started with --app Jun 2, 2022
@builuc1998
Copy link
Author

i want to use --app to be able to resize any size. without --app it cannot be resized smaller than the default chrome size. I want to display and arrange all the browsers on the screen. without --app it won't show much

ZekeLu added a commit to ZekeLu/chromedp that referenced this issue Jun 2, 2022
In the following cases, the browser will start with a non-blank tab:
1. with the "--app" option (should disable headless mode);
2. URL other than "about:blank" is placed in the command line arguments.

Fixes chromedp#1076
@builuc1998
Copy link
Author

Pull failed can you check it. thank you

@ZekeLu
Copy link
Member

ZekeLu commented Jun 3, 2022

It seems that headless-shell does not persist cookies since version 99, so a test failed after the latest tag is updated to version >= 99. I'm investing this issue. But it has nothing to do with the --app option issue.

@ZekeLu
Copy link
Member

ZekeLu commented Jun 4, 2022

I have filed #1078 to track the issue mentioned above.

ZekeLu added a commit to ZekeLu/chromedp that referenced this issue Jun 7, 2022
In the following cases, the browser will start with a non-blank tab:
1. with the "--app" option (should disable headless mode);
2. URL other than "about:blank" is placed in the command line arguments.

Fixes chromedp#1076
ZekeLu added a commit to ZekeLu/chromedp that referenced this issue Jun 8, 2022
In the following cases, the browser will start with a non-blank tab:
1. with the "--app" option (should disable headless mode);
2. URL other than "about:blank" is placed in the command line arguments.

Fixes chromedp#1076
ZekeLu added a commit that referenced this issue Jun 8, 2022
In the following cases, the browser will start with a non-blank tab:
1. with the "--app" option (should disable headless mode);
2. URL other than "about:blank" is placed in the command line arguments.

Fixes #1076
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

Successfully merging a pull request may close this issue.

2 participants