Skip to content

Conversation

@annagrin
Copy link
Contributor

@annagrin annagrin commented Jan 21, 2022

Webdev launches chrome using temp profile by default, so the users
cannot use their extensions while debugging. Allow launching chrome
in a window that is signed in as the user's default profile.

Notes:

There seems to be a limitation in chrome - it only uses the existing
session with --user-data-dir. The existing session cannot open a debug
port that dwds needs.

To work around this issue, we copy the default profile to a temporary
directory, and pass it to chrome. That seems to work, but takes time
to copy the profile. Issue a performance warning in that case.

Note that subsequent updates will only update modified files, so the
performance hit becomes smaller over time.

Closes: #1490

Webdev launches chrome using temp profile by default, so the users
cannot use their extensions while debugging. Allow launching chrome
in a window that is signed in as the user's default profile.

Notes:

There seems to be a limitation in chrome that only uses the existing
session with --user-data-dir. The existing session cannot open a
debug port that dwds needs.

To work around this issue, we copy the default profile to a temp
directory, and pass it to chrome. That seems to work, but takes time
to copy the profile. Issue a performance warning in that case.

Note that subsequent updates will only update modified files, so the
performance hit becomes smaller over time.

Closes: dart-lang#1490
@annagrin annagrin marked this pull request as draft January 21, 2022 01:41
@annagrin annagrin requested a review from grouma March 22, 2022 00:36
@annagrin annagrin marked this pull request as ready for review March 22, 2022 00:40
@annagrin annagrin requested a review from elliette March 22, 2022 00:41
@annagrin
Copy link
Contributor Author

@elliette @grouma I revived my old work on webdev to enable users to login into their chrome account and have access to extensions (ie debug extension). This includes updating the browser_launcher package and code in webdev to copy users directory. We can also use PR as example for other places where dwds is used.

@grouma
Copy link
Member

grouma commented Mar 22, 2022

I would hope that the user wouldn't need to pass the data dir. Instead webdev would automatically find and or create a reusable data dir. Is that feasible?

@annagrin
Copy link
Contributor Author

I would hope that the user wouldn't need to pass the data dir. Instead webdev would automatically find and or create a reusable data dir. Is that feasible?

I am not sure yet (need to figure out how to do that for linux and macos) so I'd prefer this to be done in a separate PR.

@annagrin
Copy link
Contributor Author

@grouma Looked into adding automatic detection, it looked simple so added it to the same PR. Let's see if the tests would work in the CI.

@annagrin annagrin merged commit 6381f97 into dart-lang:master Mar 24, 2022
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.

[webdev] Add a flag to launch chrome signed into the default profile and enable extensions

3 participants