Hacker News new | ask | show | jobs
by world32 2527 days ago
Nice work, I have been using puppeteer with chrome recently and it is a great piece of kit. If the prototype is successful will you keep the chrome and firefox packages separate or merge them and have an abstraction layer so puppeteer can issue commands regardless of chrome/firefox being used for the browser?
1 comments

They already have the same API
Yeah, that doesn't answer my question though ;)
Merging them in a single package gives you nothing at a significant price. puppeteer = wantFox ? require('puppeteer-firefox') : require('puppeteer')
Sure but now there are two separate codebases for the same API. A lot of code will be duplicated between the two codebases, you'll have to maintain two sets of issues on github etc.

If it were me I would aim to merge the firefox puppeteer into chrome puppeteer but fair enough if they want to keep them separate.

EDIT: I guess it depends on how much of the code in the puppeteer chrome codebase is tightly coupled to chrome dev tools. Like if 25% of specific to chrome, then that would mean that 75% of the code can be shared between the chrome implementation and the firefox one, in that case I think merging and hiding the 25% chrome/firefox specific stuff behind an abstraction layer is the best option.