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

Firefox use default profile #222

Closed
guybedford opened this issue Sep 25, 2021 · 5 comments · Fixed by #226
Closed

Firefox use default profile #222

guybedford opened this issue Sep 25, 2021 · 5 comments · Fixed by #226
Assignees

Comments

@guybedford
Copy link

It can be useful to have firefox use the default profile by default, specifically when configuring local certificates for network requests.

Perhaps consider changing this default?

@guybedford
Copy link
Author

I'm currently trawling through selenium / Firefox docs working out how to change this, even just documenting it could help.

@aomarks
Copy link
Member

aomarks commented Sep 25, 2021

My thinking has been that it makes sense to have a clean-room browser by default, so that extensions etc. won't interfere with the benchmark. (This is also the Selenium default). I could definitely see a useDefaultProfile: true or similar setting, though, which would know how to do that for all browsers.

We do have instructions for changing profiles in Chrome using the addArguments setting: https://github.com/Polymer/tachometer#profiles

However, it seems that we don't currently support addArguments for Firefox. I'll add that, test out profile switching, and update the docs.

@aomarks aomarks self-assigned this Sep 25, 2021
@guybedford
Copy link
Author

However, it seems that we don't currently support addArguments for Firefox. I'll add that, test out profile switching, and update the docs.

This would be an absolutely massive help thanks for considering it. Even just persisting a unique profile that can be shared between runs would be fine as well, the annoying part is having to uniquely update the certificate chain on each run.

@aomarks
Copy link
Member

aomarks commented Sep 26, 2021

I've added a new browser.profile setting in #226, which works for Firefox and Chrome. I also fixed the addArguments bug, though you shouldn't need that now that browser.profile exists.

I also published a pre-release version so you can test this out early: npm i tachometer@^0.5.10-pre.0.

See https://github.com/Polymer/tachometer/blob/4b3faa4dc12e539dd19a6db1ef3ebb37eb8b1798/README.md#profiles for documentation.

Would love to hear if it works for you. It worked for me so far on macOS and Linux.

aomarks added a commit that referenced this issue Sep 27, 2021
This PR adds a new browser.profile JSON config setting which can be used like this:

{
  "benchmarks": [
    {
      "url": "mybench.html",
      "browser": {
        "name": "firefox",
        "profile": "/Users/<username>/Library/Application Support/Firefox/Profiles/<profile-name>"
      }
    }
  ]
}

It also fixes a bug where addArguments was not being applied to Firefox, even though it was documented that it was supported.

For Chrome, it was previously supported and documented to use "addArguments": ["user-data-dir=<path>"] to achieve this same effect, but I found that the equivalent for Firefox ("-profile=<path>") caused Selenium to timeout trying to connect to the process. I wasn't able to figure out exactly why this was happening, but I did notice a dedicated setProfile method just for Firefox, which does work. So by adding the browser.profile setting, we now have a way to call this special API, plus the user doesn't need to remember the user-data-dir flag in Chrome.

Fixes #222

Also threw in a fix to tests relating to chromedriver having updated to Chrome 94 while GitHub Actions is still on Chrome 93.
@aomarks
Copy link
Member

aomarks commented Sep 27, 2021

I also published a pre-release version so you can test this out early: npm i tachometer@^0.5.10-pre.0.

Just released 0.5.10 final FYI

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