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

Add support for profile-directory command line option #963

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zvodd
Copy link

@zvodd zvodd commented Nov 30, 2021

No description provided.

// This folder contains the profile specific data like cookies & cache.
// If multiple profile exists they are typically named "Profile 1",
// "Profile 2", etc.
func UserDataProfile(profile string) ExecAllocatorOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ProfileDirectory is better.

Copy link
Author

@zvodd zvodd Dec 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was a little bit concerned about the ambiguity there. Because the word "directory" might imply that you need to specify a full path.
I think that this is a actually a rare enough use case as well as being potentially confusing enough, to cancel this pull request.

If someone needs the feature they can always just use chromedp.Flag:

opts := []chromedp.ExecAllocatorOption{
	chromedp.UserDataDir("/home/user/.config/google-chrome"),
	chromedp.Flag("profile-directory", "Profile 2"),
}
ctx, cancel := chromedp.NewExecAllocator(context.Background(), opts...)
defer cancel()
ctx, cancel = chromedp.NewContext(ctx)
defer cancel()

I think maybe providing an example in /examples might be a better alternative.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this is a actually a rare enough use case as well as being potentially confusing enough, to cancel this pull request.

Yes, I can not think of a use case for this option.

@@ -424,6 +424,17 @@ func UserDataDir(dir string) ExecAllocatorOption {
return Flag("user-data-dir", dir)
}

// UserDataProfileDir is the command line option to set the profile
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • UserDataProfileDir --> ProfileDirectory
  • the profile subdirectory under the UserData directory --> the profile directory under the user data directory

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 this pull request may close these issues.

None yet

2 participants