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
With new headless chrome (and headfull), if the tab is in the background takeScreenshot never returns (and no timeouts fire until the top level 120s timer fires;)
I made a local patch where I just added page.bringToFront() before calling element.screenshot and that seems to work though I'm not sure if there's a better fix. (ref:
It seems like when the simlar #2366 was merged it added a __bringTabToFront method to window which I could call before visualDiff as well but it seems like an implementation detail I shouldn't rely on.
For now, I can use patch-package but I'd love to hear thoughts on this approach.
For completeness, similar to other new headless bugs, this can be fixed by setting concurrency to 1 as well.
(As an aside, given we patched requestAnimationFrame I wonder if we should also patch client side IntersectionObserver to call bringTabToFront...)
The text was updated successfully, but these errors were encountered:
With new headless chrome (and headfull), if the tab is in the background
takeScreenshot
never returns (and no timeouts fire until the top level 120s timer fires;)This is because
element.screenshot
in puppeteer relies onIntersectionObserver
(viascrollIntoViewIfAble
) doesn't work in backgrounded tabs. (ref: https://github.com/puppeteer/puppeteer/blob/682bb682116437dc803afd613eb95fd2efd65a65/packages/puppeteer-core/src/api/ElementHandle.ts#L1479)I made a local patch where I just added
page.bringToFront()
before callingelement.screenshot
and that seems to work though I'm not sure if there's a better fix. (ref:web/packages/test-runner-visual-regression/src/visualRegressionPlugin.ts
Line 79 in 17cfc0d
It seems like when the simlar #2366 was merged it added a
__bringTabToFront
method to window which I could call beforevisualDiff
as well but it seems like an implementation detail I shouldn't rely on.For now, I can use patch-package but I'd love to hear thoughts on this approach.
For completeness, similar to other new headless bugs, this can be fixed by setting concurrency to 1 as well.
(As an aside, given we patched
requestAnimationFrame
I wonder if we should also patch client sideIntersectionObserver
to call bringTabToFront...)The text was updated successfully, but these errors were encountered: