Closed stevez closed 11 months ago
No, this is not a duplication of #56 in facto after calling playAudit it runs an extra browser because we are not passing any puppeteer page to "lighthouselib" :
https://github.com/abhinaba-ghosh/playwright-lighthouse/blob/master/src/task.js#L85
Pupetter receives 4 parameters as you can see here:
https://github.com/GoogleChrome/lighthouse/blob/main/core/index.js#L39
The last parameter accepts a puppeteer page instance. If it is not received it will try to connect to the playwright browser instance and open a new page:
https://github.com/GoogleChrome/lighthouse/blob/main/core/gather/navigation-runner.js#L281
That will cause a second browser to be open. The problem is that won't share any session data with Plawright. We have a lack of flexibility when we use this library
I just tried the latest version of this library, what I found is it launched 2 browsers: 1 is launched by playwright, the other seems launched by the lighthouse, I wonder if it is the expected behaviour or not?