diff --git a/browser/components/preferences/privacy.inc.xhtml b/browser/components/preferences/privacy.inc.xhtml
index 28e325c938de..7427c13c3453 100644
--- a/browser/components/preferences/privacy.inc.xhtml
+++ b/browser/components/preferences/privacy.inc.xhtml
@@ -1227,7 +1227,7 @@
+ aria-labelledby="dohGroupMessage">
+
+
+
+
+
+
+
+
+
+
+
{
+ // Default Protection: Use default mode and disable OHttp
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_NATIVEONLY);
+ Services.prefs.setBoolPref("network.trr.use_ohttp", false);
+ modeButtonPressed(e);
+ });
+ setEventListener("dohEnabledRadio", "command", (e) => {
+ // Enabled Protection: Use enabled mode and disable OHttp
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRFIRST);
+ Services.prefs.setBoolPref("network.trr.use_ohttp", false);
+ modeButtonPressed(e);
+ });
+ setEventListener("dohStrictRadio", "command", (e) => {
+ // Strict Protection: Set TRR to strict mode but disable OHttp
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRONLY);
+ Services.prefs.setBoolPref("network.trr.use_ohttp", false);
+ modeButtonPressed(e);
+ });
+ setEventListener("dohUltraRadio", "command", (e) => {
+ // Ultra Protection: Enable OHttp and set default mode
+ Services.prefs.setBoolPref("network.trr.use_ohttp", true);
+ let fallbackDropdown = document.getElementById("dohUltraFallbackMode");
+ if (fallbackDropdown) {
+ // Default to fallback allowed unless user previously selected no-fallback
+ if (fallbackDropdown.value === "no-fallback") {
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRONLY);
+ } else {
+ fallbackDropdown.value = "fallback";
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRFIRST);
+ }
+ fallbackDropdown.disabled = false;
+ } else {
+ // Fallback if dropdown not found
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRFIRST);
+ }
+ modeButtonPressed(e);
+ });
+ setEventListener("dohOffRadio", "command", (e) => {
+ // Off Protection: Set TRR to off and disable OHttp
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRROFF);
+ Services.prefs.setBoolPref("network.trr.use_ohttp", false);
+ modeButtonPressed(e);
+ });
this.populateDoHResolverList("dohEnabled");
this.populateDoHResolverList("dohStrict");
+ this.populateUltraFallbackDropdown();
Preferences.get("network.trr.uri").on("change", () => {
gPrivacyPane.updateDoHResolverList("dohEnabled");
@@ -885,7 +985,19 @@ var gPrivacyPane = {
"change",
gPrivacyPane.highlightDoHCategoryAndUpdateStatus
);
+ // Also listen for OHttp pref changes
+ Preferences.get("network.trr.use_ohttp").on(
+ "change",
+ gPrivacyPane.highlightDoHCategoryAndUpdateStatus
+ );
+
+
+
+
this.highlightDoHCategoryAndUpdateStatus();
+
+ // Initialize Ultra Protection checkbox state
+ this.initUltraProtectionState();
Services.obs.addObserver(this, "network:trr-uri-changed");
Services.obs.addObserver(this, "network:trr-mode-changed");
@@ -913,6 +1025,54 @@ var gPrivacyPane = {
}
},
+ populateUltraFallbackDropdown() {
+ let menu = document.getElementById("dohUltraFallbackMode");
+ if (!menu) return;
+
+ // populate the fallback options like provider dropdowns do
+ menu.removeAllItems();
+
+ let fallbackItem = menu.appendItem("Allow fallback to system DNS if secure DNS fails", "fallback");
+ let noFallbackItem = menu.appendItem("Never fall back to system DNS (sites may not load if secure DNS fails)", "no-fallback");
+
+ // Set initial selection
+ menu.value = "fallback";
+
+ // Add event listener
+ menu.addEventListener("command", (e) => {
+ let ohttpEnabled = Services.prefs.getBoolPref("network.trr.use_ohttp", false);
+ let trrMode = Services.prefs.getIntPref("network.trr.mode", 0);
+ if (ohttpEnabled && (trrMode == Ci.nsIDNSService.MODE_TRRFIRST || trrMode == Ci.nsIDNSService.MODE_TRRONLY)) {
+ if (e.target.value === "no-fallback") {
+ // No fallback - switch to TRR Only mode
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRONLY);
+ } else {
+ // Allow fallback - switch to TRR First mode
+ Services.prefs.setIntPref("network.trr.mode", Ci.nsIDNSService.MODE_TRRFIRST);
+ }
+ }
+ });
+ },
+
+ initUltraProtectionState() {
+ // Initialize the Ultra Protection fallback dropdown state
+ let ohttpEnabled = Services.prefs.getBoolPref("network.trr.use_ohttp", false);
+ let trrMode = Services.prefs.getIntPref("network.trr.mode", 0);
+ let fallbackDropdown = document.getElementById("dohUltraFallbackMode");
+
+ if (fallbackDropdown) {
+ if (ohttpEnabled && (trrMode == Ci.nsIDNSService.MODE_TRRFIRST || trrMode == Ci.nsIDNSService.MODE_TRRONLY)) {
+ // Ultra Protection is active
+ fallbackDropdown.disabled = false;
+ fallbackDropdown.value = (trrMode == Ci.nsIDNSService.MODE_TRRONLY) ? "no-fallback" : "fallback";
+ } else {
+ // Ultra Protection is not active
+ fallbackDropdown.disabled = true;
+ fallbackDropdown.value = "fallback";
+ }
+ }
+ },
+
initWebAuthn() {
document.getElementById("openWindowsPasskeySettings").hidden =
!Services.prefs.getBoolPref(
diff --git a/waterfox/browser/components/preferences/content/general.js b/waterfox/browser/components/preferences/content/general.js
index 36fbf9819276..ebdf158b11b7 100644
--- a/waterfox/browser/components/preferences/content/general.js
+++ b/waterfox/browser/components/preferences/content/general.js
@@ -82,10 +82,7 @@ const _gMainPaneOverlay = {
}
document.initialized = true;
}
- this.setEventListener("enableObliviousDns", "click", () => {
- const value = document.getElementById("enableObliviousDns").checked ? 2 : 0;
- Services.prefs.setIntPref("network.trr.mode", value);
- });
+
},
tocGenerate() {
diff --git a/waterfox/browser/components/preferences/content/preferences-other.xhtml b/waterfox/browser/components/preferences/content/preferences-other.xhtml
index 44e5b0509e89..3d0420ede4d9 100644
--- a/waterfox/browser/components/preferences/content/preferences-other.xhtml
+++ b/waterfox/browser/components/preferences/content/preferences-other.xhtml
@@ -83,10 +83,6 @@
-
-
-
diff --git a/waterfox/browser/components/preferences/content/privacy.js b/waterfox/browser/components/preferences/content/privacy.js
index c63689e95a29..d61001cf643f 100644
--- a/waterfox/browser/components/preferences/content/privacy.js
+++ b/waterfox/browser/components/preferences/content/privacy.js
@@ -36,10 +36,7 @@ const _gPrivacyPaneOverlay = {
javascriptPermissions.getAttribute("preference")
).value;
- const obliviousDns = document.getElementById("enableObliviousDns");
- obliviousDns.checked = Preferences.get(
- obliviousDns.getAttribute("preference")
- ).value;
+
},
/**