Closed Bug 1863326 Opened 2 years ago Closed 1 year ago

In dark mode (via Dark Reader extension), a white flash appears when loading a new page

Categories

(WebExtensions :: Developer Outreach, defect, P5)

Firefox 119
Desktop
Unspecified
defect

Tracking

(firefox119 affected)

RESOLVED WORKSFORME
Tracking Status
firefox119 --- affected

People

(Reporter: DeepChirp, Unassigned)

References

Details

Attachments

(2 files)

Attached image 2023-11-06 222438.gif

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0

Steps to reproduce:

  • Launch Firefox and enable Dark Mode
  • Open a webpage

Actual results:

Before the page loads, a white flash appears

Expected results:

The white flash should not appear until the page loads

Component: Untriaged → Tabbed Browser

I was able to reproduce the white flash on Win10x64 using FF build 119.0.
Mark issue as new.

Status: UNCONFIRMED → NEW
Has STR: --- → yes
Ever confirmed: true
Hardware: Unspecified → Desktop

We suspect there are a few issues here:

  1. In non-China-region Bing (at least in Canada and Italy), the search result page for Github doesn't directly link to Github, but to an intermediary that redirects to the actual Github page, and that intermediary is a page with a white background.
  2. In China-region Bing (which the screencapture appears to be on), the user is redirected to https://github.com/login, before going to https://github.com, and we suspect that this page for the user / their region is also one with a white background.

Ideally, these sites should be using the CSS properties for detecting user preference for light and dark themes to set their background colours.

Component: Tabbed Browser → Desktop
Product: Firefox → Web Compatibility

(In reply to Mike Conley (:mconley) (:⚙️) from comment #2)

We suspect there are a few issues here:

  1. In non-China-region Bing (at least in Canada and Italy), the search result page for Github doesn't directly link to Github, but to an intermediary that redirects to the actual Github page, and that intermediary is a page with a white background.
  2. In China-region Bing (which the screencapture appears to be on), the user is redirected to https://github.com/login, before going to https://github.com, and we suspect that this page for the user / their region is also one with a white background.

Ideally, these sites should be using the CSS properties for detecting user preference for light and dark themes to set their background colours.

In fact, this is not related to Bing, nor is it related to GitHub. I casually searched for a webpage and changed the direction of a hyperlink inside to github. com or another website. As long as it opens in a new tab, the screen will still be blank at the beginning. Please see my newly uploaded attachment.
link: https://zhidao.baidu.com/question/297091740.html

Attached image 2023-11-15 000343.gif
Duplicate of this bug: 1864444

The same thing seems to be happening with brave.com according to bug 1864444.

Summary: In dark mode, a white flash appears when loading a new page → In dark mode (via Dark Reader extension), a white flash appears when loading a new page
Component: Desktop → Untriaged
Product: Web Compatibility → WebExtensions

This seems to be an add-on issue. Perhaps it is still initializing or something like that. The DarkReader extension author should investigate this issue first.

A potential way to address this issue is through the browserSettings.overrideContentColorScheme extension API* that enables extensions to set the default theme for content. If set to dark, then the issue reported here would not happen, regardless of content script access (there are more ways for extensions to not be able to run scripts, e.g. bug 1411641).

* https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserSettings/overrideContentColorScheme

Severity: -- → S4
Component: Untriaged → Developer Outreach
Priority: -- → P5

(In reply to Rob Wu [:robwu] from comment #7)

This seems to be an add-on issue. Perhaps it is still initializing or something like that. The DarkReader extension author should investigate this issue first.

A potential way to address this issue is through the browserSettings.overrideContentColorScheme extension API* that enables extensions to set the default theme for content. If set to dark, then the issue reported here would not happen, regardless of content script access (there are more ways for extensions to not be able to run scripts, e.g. bug 1411641).

* https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/browserSettings/overrideContentColorScheme

But the problem is that if Firefox is applied to a dark mode, the background color before loading the page should be black, not white. The white here is not caused by the lack of loading speed of Dark Reader. For example, I am now in mainland China and cannot access the BBC webpage. At this time, if I open the BBC page, the page has always been white.

What you're describing is when your system and/or browser is using the light theme.

Is your issue fixed when you enable Dark theme at "Website appearance", as documented at the following page?
https://support.mozilla.org/en-US/kb/change-website-appearance-settings-firefox

(In reply to Rob Wu [:robwu] from comment #9)

What you're describing is when your system and/or browser is using the light theme.

Is your issue fixed when you enable Dark theme at "Website appearance", as documented at the following page?
https://support.mozilla.org/en-US/kb/change-website-appearance-settings-firefox

I did select the dark mode, but the white color before the page loads is still there

This issue seems to be alleviated in Firefox 120.

(In reply to 1434323966 from comment #11)

This issue seems to be alleviated in Firefox 120.

Will go ahead and close this then.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
See Also: → 1869329
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: