You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if waiting for Target.targetdestroyed is necessary if assuming target eventually gets cleaned up. Page gets consumed and if you are dealing with raw ids you are on your own.
Agree. But there is a potential race condition for following scenario:
let el = page.find_element("input#searchInput").await?;
...page.close().await?;
...// this will fail because page is already closed.el.click().await?;
This el.click() will fail regardless, but at the moment the reason it fails is because the click command is sent to the browser and the browser returns an error. This happens because the Target of the Page is not removed yet and is still able to receive events sent from an Element. Preferably the el.click() should fail with a SendError because the receiver should already be dropped at this point, preventing the overhead of sending a request that is guaranteed to fail.
I think it's more important to figure out a way to just destroy the page target since for majority of cases you don't care about unload and just want to clean up.
This can be done with Target.closeTarget instead, that's how puppeteer does it.
Agree. But there is a potential race condition for following scenario:
This
el.click()
will fail regardless, but at the moment the reason it fails is because the click command is sent to the browser and the browser returns an error. This happens because theTarget
of thePage
is not removed yet and is still able to receive events sent from anElement
. Preferably theel.click()
should fail with aSendError
because the receiver should already be dropped at this point, preventing the overhead of sending a request that is guaranteed to fail.This can be done with
Target.closeTarget
instead, that's how puppeteer does it.Originally posted by @mattsse in #12 (comment)
The text was updated successfully, but these errors were encountered: