Skip to content

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.

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

@kenshaw kenshaw closed this Apr 1, 2025
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.

3 participants