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
{{ message }}
Repository navigation
Seems like page-visibility option on BrowserWindow is broken #3225
In Electron 0.34.0, it doesn't seem like my page-visibility setting is being honored. I'm using it here to ensure test windows continue running tests even if they're in the background. It was working, but now it doesn't seem to be.
It seems that from Chrome 45 setting page-visibility doesn't prevent performance throttling any more, can you try using the --disable-renderer-backgrounding command line switch?
This flag is application-wide, you can append it before creating the test window so normal users won't be affected, but the windows created after that will still be affected though.
From the source code the only way to prevent only one window being put into background is to keep playing audio in the page.
It seems that Chrome had a bug that it doesn't update the background information immediately when audio starts/stops, and it got fixed very recently, I think we are hitting this bug. The --disable-renderer-backgrounding switch seems to be our only option.
I'm actually seeing that it's working locally. Running audio as I did in the above PR causes tests to complete in the background locally. I am seeing 20 second animation frames on CI regardless of the throtlling settings, either with the flag or the audio hack. For now I just increased the timeout, but it would be nice to know why these frames are taking so long.
@zcbenz Can you reference me to the relevant location in the Chromium source so I can open an issue on the Chromium bug tracker. After talking to some developers at the Chrome Dev Summit it seems like this is something they care about correcting.
Activity
zcbenz commentedon Oct 27, 2015
It seems that from Chrome 45 setting
page-visibilitydoesn't prevent performance throttling any more, can you try using the--disable-renderer-backgroundingcommand line switch?Refs #2822.
nathansobo commentedon Nov 1, 2015
Is this something that can be done for just a test window or is it application-wide?
zcbenz commentedon Nov 2, 2015
This flag is application-wide, you can append it before creating the test window so normal users won't be affected, but the windows created after that will still be affected though.
From the source code the only way to prevent only one window being put into background is to keep playing audio in the page.
nathansobo commentedon Nov 6, 2015
One more question... is it possible to only append a flag for a single window's render process?
zcbenz commentedon Nov 7, 2015
Yeah it is possible for renderer process, but
--disable-renderer-backgroundingis read in the main process.Playing audio is not a so bad option though, it can be done by creating an empty audio on the fly.
nathansobo commentedon Nov 7, 2015
⚡ Tried the audio hack. Seems to work. Thanks a ton for that idea!
nathansobo commentedon Nov 8, 2015
I'm still getting timeout failures on CI where animation frames aren't firing. Am I doing the sound thing wrong? I thought it was preventing throttling locally but maybe I was mistaken: https://github.com/atom/atom/pull/9485/files
zcbenz commentedon Nov 9, 2015
It seems that Chrome had a bug that it doesn't update the background information immediately when audio starts/stops, and it got fixed very recently, I think we are hitting this bug. The
--disable-renderer-backgroundingswitch seems to be our only option.nathansobo commentedon Nov 10, 2015
I'm actually seeing that it's working locally. Running audio as I did in the above PR causes tests to complete in the background locally. I am seeing 20 second animation frames on CI regardless of the throtlling settings, either with the flag or the audio hack. For now I just increased the timeout, but it would be nice to know why these frames are taking so long.
nathansobo commentedon Nov 20, 2015
@zcbenz Can you reference me to the relevant location in the Chromium source so I can open an issue on the Chromium bug tracker. After talking to some developers at the Chrome Dev Summit it seems like this is something they care about correcting.
zcbenz commentedon Nov 23, 2015
The code that determines whether to lower the priority of renderer process is located at: https://code.google.com/p/chromium/codesearch#chromium/src/content/browser/renderer_host/render_process_host_impl.cc&sq=package:chromium&type=cs&l=2369
And the
page-visibilityoption is implemented at:https://github.com/atom/electron/blob/master/atom/renderer/atom_renderer_client.cc#L207-L218
I'm not sure from when it stops working in Chromium.
zenorocha commentedon Dec 12, 2015
Thanks for sharing your solution @zcbenz!
Prevents Chrome performance throttling
fix(electron): Update `beforeunload` event handler (see details):