Closed route closed 4 years ago
Does the pop up window actually open? Maybe some pop up blocking logic is being invoked?
@JoelEinbinder I cannot find target to attach to to check, there are only 2 targets main page and default context target. Feels like Page.windowOpen
event happens and target is never created tried on many Chrome and Chromium versions. Though on my local machine it happens like 1 out 50 attempts but on CI I see 1 out of 6 and build is always failing https://travis-ci.org/machinio/cuprite/jobs/485380005 No no alerts or confirm dialogs involved, only plain windows.
I think the reason is that in the test I'm trying to open the same window twice (url is eventually the same) and it happens very fast so that this bug shows up. Looking at events you see that previous window is successfully closed and target is detached, though new window isn't opened.
Hm. Maybe Target.closeTarget is not waiting for the target to be destroyed. In that case you would have a race between the next window.open call and the target actually closing. If you called window.open before TargetDestroyed, it would focus the old window instead of opening a new one. Try awaiting targetDestroyed on the first window before opening the second, see if that fixes it
>>> {"method":"Target.closeTarget","params":{"targetId":"712883E25D7105B6A3C10D20C6834052"},"id":8}
<<< { "method": "Inspector.detached", "params": { "reason": "target_closed"} }
<<< {"id":8,"result":{"success":true}}
It returns success and there's no such target anymore if I try to call Target.getTargets
. Yes feels like race condition but seems it's not in my lib, I was also thinking that maybe caching is involved but turning it off didn't improve it.
I don’t disagree that it’s probably not in your lib. It would just help me track down the bug faster when I go to fix it tomorrow.
@JoelEinbinder I'm open-minded, I just tried debugging it for a day or so and didn't find anything in my code haha :) Adding sleep between next attempt to open window helps and build is green now https://travis-ci.org/machinio/cuprite/builds/485782599
@JoelEinbinder btw if you could point me to the code related to the devtools protocol it would help me a lot to understand everything, I would spend some time playing around
This repository is related to Chrome DevTools Protocol, but does not track issues regarding its definition or implementation. If you want to file an issue for the Chrome DevTools Protocol, please open an issue on https://crbug.com under component: Platform>DevTools>Platform
. Thanks in advance!
I'm seeing intermittent bug with Page.windowOpen event. If window is opened and closed and then the same window is opened again sometimes target is never created:
As you can see
Page.windowOpen
event happened but target is never created no matter how long you wait for it.