Skip to content

Commit

Permalink
Bug 1844346 - Use prefersColorSchemeOverride to inherit dark PBM them…
Browse files Browse the repository at this point in the history
…e for profile creation wizard dialog. r=desktop-theme-reviewers,dao

This is similar to the fix we did for Bug 1749377 where Page Info windows opened from PBM windows didn't apply the dark theme correctly.

Differential Revision: https://phabricator.services.mozilla.com/D184498
  • Loading branch information
Trikolon committed Aug 1, 2023
1 parent 985fcbf commit fea6493
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions toolkit/profile/content/createProfileWizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ var gProfileDisplay;

// Called once when the wizard is opened.
function initWizard() {
// Inherit color scheme overrides from parent window. This is to inherit the
// color scheme of dark themed PBM windows.
let openerColorSchemeOverride =
window.opener?.browsingContext?.top.prefersColorSchemeOverride;
if (
openerColorSchemeOverride &&
window.browsingContext == window.browsingContext.top
) {
window.browsingContext.prefersColorSchemeOverride =
openerColorSchemeOverride;
}

try {
gProfileService = C[ToolkitProfileService].getService(
I.nsIToolkitProfileService
Expand Down

0 comments on commit fea6493

Please sign in to comment.