0

When I load up a chromedp context I want it to use my default Chrome session. Keeping all session data and things. So when I load up Dropbox, Discord, Twitter, YouTube... etc I should already logged in and can readily interact with them through chromedp.

I understand there may be security concerns so this action may be impossible. I am only building this tool for personal use and to automate some generic web tasks. I could of course copy all my cookies, auth headers over to the program or physically add logging in using given credentials but it would be easier if I could just specify one flag to deal with using existing detail. I am almost certain that this functionality is in puppeteer?

I have tried adding chromedp.Flag("profile-directory", `"Default"`). But it produces a blank window (see below) rather than doing following any Actions. Removing this line will make it function as expected but in an anonymous session.

Ben
  • 3,160
  • 3
  • 17
  • 34

1 Answers1

0

i set these flags
then a new profile was created
then i synced it with my google account
and every time i run chromedp with sudo
it syncs with my account
Edit: You can set UserDataDir in a non hidden folder
(e.g. /home/user/Profile 1/)
and you won't need to use subo

chromedp.Flag("profile-directory","Profile 1"), chromedp.UserDataDir("/home/user/.config/chromium/Profile 1"), chromedp.Flag("disable-sync", false),

nigun
  • 66
  • 1
  • 6