web icon indicating copy to clipboard operation
web copied to clipboard

visibilityState no longer works with concurrency>1 after chrome 120

Open frankborden opened this issue 5 months ago • 0 comments

We have some code that uses visibilityState for reporting etc. When we upgraded our tests from Chrome 120 to 128/129, they started to fail and timeout, showing visibilityState surprisingly becomes "hidden" and likewise our focus/blur event get stopped causing additional failures. We found that forcing serial tests fixed this issue, but of course we would prefer to keep the concurrency for speed.

I made a simple reproduction with code like this in a click handler:

if (document.visibilityState === "visible") {
  this.count++;
}

and some tests that click the button and assert the count increase. The tests only pass with concurrency=1, but it used to work.

frankborden avatar Sep 18 '24 10:09 frankborden