Closed Bug 1590464 Opened 5 years ago Closed 4 years ago

[meta] Allow browser selection when starting Puppeteer

Categories

(Remote Protocol :: Agent, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: impossibus, Unassigned)

References

Details

(Keywords: meta)

Currently, the puppeteer and puppeteer-core packages only support starting up Chromium.

Instead, we want a user-friendly mechanism for selecting different browsers at runtime.

This bug tracks iterations on this feature and its integration into https://github.com/GoogleChrome/puppeteer

web-platform tests use --product to specify the type of browser. Maybe this could be re-used for puppeteer too for browser selection. That would also allow us to have a code path beside the puppeteer-firefox code, so that we don't mess with users still using the puppeteer nodejs package.

(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] from comment #1)

web-platform tests use --product to specify the type of browser. Maybe this could be re-used for puppeteer too for browser selection. That would also allow us to have a code path beside the puppeteer-firefox code, so that we don't mess with users still using the puppeteer nodejs package.

Puppeteer is an node library, one does not start Puppeteer directly from the command-line. A flag like --product would only be relevant in, say, a test harness that uses Puppeteer under the hood, but that's not the focus here as I understand it.

Here is a rough summary of what questions/ideas have come up so far. A lot of this goes (way) beyond the mvp in Bug 1590467, but I want record it anyway. I'll write this in terms of Firefox, but it applies to other browsers as well.

  • browser-specific Launcher.js code -- what should unified or browser agnostic launch options looks like? Right now they are obviously geared to Chrome. Helpful error messages/clear documentation about what is vendor-specific or not supported.
  • For Firefox, there is the question of profile set up and preferences. At a minimum we rely on a pref to start the remote agent. We can just accept a path to a profile for now (which is what is done in the current workaround for Firefox), but eventually I think we want to take care of that for the user so that it's as convenient as possible. That means writing some profile management in a node.js environment from scratch. I haven't seen any prior art here.
  • ato: "Also we need to come up with a proposal for how to store this state internally in the client, i.e. which browser is currently running. The more long-term approach should probably be something along the lines of WebDriver capabilities."
  • Should Puppeteer offer to download an appropriate Firefox version for convenience?
Type: enhancement → task
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.