-
Notifications
You must be signed in to change notification settings - Fork 9k
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
[Bug]: When puppeteer connects to existing electron(chromium) it does not have access to existed pages #11708
Comments
This issue has an outdated Puppeteer version: |
21.7.0 Made a typo (issue was introduced in 21.4.0 initially ) |
@sirdir could you provide the CDP log ( |
I did run the puppeteer with
But the old version
|
This one stands-out just checked, when in
|
@sirdir so that is working as expected since CDP should auto-attach to tab target not to the page. If you make the change you did locally it might not work as expected in Electron (and definitely not in the browser). I see that Electron reports Chrome/108.0.5359.215 which is a not supported version (see https://pptr.dev/chromium-support). I suggest you try using an older Puppeteer version that matches the Electron version, e.g., v19.2.0. |
Background
The issue is cause by this commit #11099 @OrKoN
We have electron application and currently using puppeteer-core to write test for it.
We start application and connecting puppeteer to it via web socket.
I do not want go into specific, but Electron implies that puppeteer not the one who creates the pages, electron does.
So, when we start application we can already have some state of it with several windows opened(business logic reflected in tests).
but after
21.4.0
it stopped worked, because pages that have been opened does not firetargetcreated
event anymoremore to it, as user I see that there several windows opened but
browser.pages()
return empty array andbrowser.targers()
contains only one object and it is a browser, no pagestrying to make pages discoverable again dos not work, look like its to late at this stage
Expectation
if puppeteer connects to the existing browser
browser.pages()
orbrowser.targets()
should return existing pages in arrayReality
when puppeteer connects to the existing electron application(chromium) with several windows/tabs opened
browser.pages()
andbrowser.targets()
do not return pagesPuppeteer configuration file (if used)
No response
Puppeteer version
21.7.0
Node version
18.18.2
Package manager
yarn
Package manager version
3.2.4
Operating system
Linux
The text was updated successfully, but these errors were encountered: