File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,3 +13,16 @@ import 'core-js/actual/promise/with-resolvers.js'
1313// @see https://github.com/cypress-io/cypress/issues/20341
1414Cypress . on ( 'uncaught:exception' , ( err ) => ! err . message . includes ( 'ResizeObserver loop limit exceeded' ) )
1515Cypress . on ( 'uncaught:exception' , ( err ) => ! err . message . includes ( 'ResizeObserver loop completed with undelivered notifications' ) )
16+
17+ // Defer ResizeObserver callbacks one frame to break floating UI sync loops
18+ // that otherwise tank the renderer and trigger Electron's unresponsive kill.
19+ Cypress . on ( 'window:before:load' , ( win ) => {
20+ const Original = win . ResizeObserver
21+ win . ResizeObserver = class extends Original {
22+ constructor ( callback : ResizeObserverCallback ) {
23+ super ( ( entries , observer ) => {
24+ win . requestAnimationFrame ( ( ) => callback ( entries , observer ) )
25+ } )
26+ }
27+ }
28+ } )
You can’t perform that action at this time.
0 commit comments