ma1 pushed to branch base-browser-128.9.0esr-14.5-1 at The Tor Project / Applications / Tor Browser
Commits: 770f769b by Dan Ballard at 2025-04-03T10:48:25-07:00 BB 43544: DoH pane undefined error in Privacy and Security
From: Sarah Jamie Lewis sarah@openprivacy.ca Date: Fri, 28 Feb 2025 09:30:45 -0800 Subject: [PATCH 1/1] DoH Settings: Check for nulll gParentalControlsService
When the parental controls service is disabled in a build, the DoH settings now display the correct stauts when Increased or Max Protection is enabled.
Previously, selecting either of these options would cause DoH to be enabled, but the "Status" and "Provider" fields would not be properly populated, due to a check on the gParentalControlsService causing an error.
This check is now identical to the same check in DownloadIntegration.sys.mjs
Apply 1 suggestion(s) to 1 file(s)
Co-authored-by: ma1 giorgio@maone.net
- - - - -
1 changed file:
- browser/components/preferences/privacy.js
Changes:
===================================== browser/components/preferences/privacy.js ===================================== @@ -54,11 +54,12 @@ ChromeUtils.defineLazyGetter(lazy, "AboutLoginsL10n", () => { return new Localization(["branding/brand.ftl", "browser/aboutLogins.ftl"]); });
-XPCOMUtils.defineLazyServiceGetter( - lazy, - "gParentalControlsService", - "@mozilla.org/parental-controls-service;1", - "nsIParentalControlsService" +ChromeUtils.defineLazyGetter(lazy, "gParentalControlsService", () => + "@mozilla.org/parental-controls-service;1" in Cc + ? Cc["@mozilla.org/parental-controls-service;1"].createInstance( + Ci.nsIParentalControlsService + ) + : null );
// TODO: module import via ChromeUtils.defineModuleGetter @@ -735,7 +736,7 @@ var gPrivacyPane = { mode == Ci.nsIDNSService.MODE_TRRFIRST || mode == Ci.nsIDNSService.MODE_TRRONLY ) { - if (lazy.gParentalControlsService.parentalControlsEnabled) { + if (lazy.gParentalControlsService?.parentalControlsEnabled) { return "preferences-doh-status-not-active"; } let confirmationState = Services.dns.currentTrrConfirmationState; @@ -758,7 +759,7 @@ var gPrivacyPane = { if ( (mode == Ci.nsIDNSService.MODE_TRRFIRST || mode == Ci.nsIDNSService.MODE_TRRONLY) && - lazy.gParentalControlsService.parentalControlsEnabled + lazy.gParentalControlsService?.parentalControlsEnabled ) { errReason = Services.dns.getTRRSkipReasonName( Ci.nsITRRSkipReason.TRR_PARENTAL_CONTROL
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/770f769b...
tbb-commits@lists.torproject.org