MarvellousSuspender icon indicating copy to clipboard operation
MarvellousSuspender copied to clipboard

Blinking white background when switching tabs

Open jarlefosen opened this issue 2 years ago • 6 comments

Please complete the following information when submitting a feature request or bug report.

  • Extension version: v7.1.6.2
  • Browser name & version: Chrome 99.0.4844.51
  • Operating system & version: macOS 12.2.1

When switching between suspended tabs I see a bright flash before each suspended.html page is loaded. This is usually fine, but in the evenings with dim lights around me they become quite noticeable.

Would it be possible to have a dark default background before content is loaded? Providing a video explaining the issue, but be aware there's blinking!

https://user-images.githubusercontent.com/2993240/158669588-2979e869-1b33-493c-91c3-120af07dc444.mov

jarlefosen avatar Mar 16 '22 19:03 jarlefosen

I've had this happen when I had the settings for "Apply Chrome's built-in memory-saving when suspending" turned on. I'm worried it might be an issue on Google's/Chrome's side.

TheNonWu avatar Mar 29 '22 16:03 TheNonWu

Does this still happen on a new version of Chrome? I can't reproduce this with Apply Chrome's built-in memory-saving when suspending turned on, with Version 100.0.4896.60.

Technetium1 avatar Mar 30 '22 20:03 Technetium1

I was able to make the feature work a bit better for my own use-case where the system theme matches the extension theme.

Wrapping the body of suspended.html in an inner div with hide-initially class, then proceed to set a default background of the body based on your system theme.

suspended.html

- <body class="suspended-page hide-initially">
+ <body class="hide-initially">
+	<div class="newbody suspended-page hide-initially">
  ...
+	</div>
 </body>

suspended.css

+ @media (prefers-color-scheme: dark) {
+     body.hide-initially {
+         background: #222;
+     }
+ }

- body .hide-initially {
+ .newbody .hide-initially {
+     display: none !important;
+ }

 /* change "body" to ".newbody" for the rest of the file */

@Technetium1 I haven't tested the latest version yet, was just playing around with the CSS of the suspended page right now. Will reload and try again asap.

EDIT: Reloaded latest version of Chrome and I still experience the issue.

jarlefosen avatar Mar 30 '22 20:03 jarlefosen

I was coming to suggest the @media (prefers-color-scheme: dark) { solution too. I wonder if it could be that CSS files are render blocking and so while it waits the 25ms (in my quick test) for the CSS to load (it is in browser as part of the extension, no real download) we get the white until it stops blocking and renders. Putting the CSS, or at least the main background color CSS inline could potentially help with the blink of white.

aaronbarker avatar Jul 20 '22 21:07 aaronbarker

Expieriencing the white blinks in dark mode too on Mac exactly as in the reported video. Did anyone test if the inlined CSS solves the problem?

jarivasell avatar Sep 13 '22 20:09 jarivasell

Has the possibility of Chrome's theme causing this been eliminated?

Technetium1 avatar Sep 14 '22 14:09 Technetium1