@@ -21,6 +21,11 @@ ChromeUtils.defineESModuleGetters(lazy, {
21
21
setTimeout : "resource://gre/modules/Timer.sys.mjs" ,
22
22
} ) ;
23
23
24
+ XPCOMUtils . defineLazyModuleGetters ( lazy , {
25
+ NimbusFeatures : "resource://nimbus/ExperimentAPI.jsm" ,
26
+ ExperimentAPI : "resource://nimbus/ExperimentAPI.jsm" ,
27
+ } ) ;
28
+
24
29
// When this is set we suppress automatic TRR selection beyond dry-run as well
25
30
// as sending observer notifications during heuristics throttling.
26
31
XPCOMUtils . defineLazyPreferenceGetter (
@@ -235,10 +240,19 @@ export const DoHController = {
235
240
// If we enter this branch it means that no automatic selection was possible.
236
241
// In this case, we try to set a fallback (as defined by DoHConfigController).
237
242
if ( ! lazy . Preferences . isSet ( ROLLOUT_URI_PREF ) ) {
238
- lazy . Preferences . set (
239
- ROLLOUT_URI_PREF ,
240
- lazy . DoHConfigController . currentConfig . fallbackProviderURI
241
- ) ;
243
+ let uri = lazy . DoHConfigController . currentConfig . fallbackProviderURI ;
244
+
245
+ // If part of the treatment branch use the URL from the experiment.
246
+ try {
247
+ let ohttpURI = lazy . NimbusFeatures . dooh . getVariable ( "ohttpUri" ) ;
248
+ if ( ohttpURI ) {
249
+ uri = ohttpURI ;
250
+ }
251
+ } catch ( e ) {
252
+ console . error ( `Error getting dooh.ohttpURI: ${ e . message } ` ) ;
253
+ }
254
+
255
+ lazy . Preferences . set ( ROLLOUT_URI_PREF , uri ) ;
242
256
}
243
257
this . runHeuristicsThrottled ( "startup" ) ;
244
258
Services . obs . addObserver ( this , kLinkStatusChangedTopic ) ;
@@ -359,7 +373,12 @@ export const DoHController = {
359
373
networkID : getHashedNetworkID ( ) ,
360
374
} ;
361
375
362
- if ( results . steeredProvider ) {
376
+ const oHTTPexperiment = lazy . ExperimentAPI . getExperimentMetaData ( {
377
+ featureId : "dooh" ,
378
+ } ) ;
379
+
380
+ // When the OHTTP experiment is active we don't want to enable steering.
381
+ if ( results . steeredProvider && ! oHTTPexperiment ) {
363
382
Services . dns . setDetectedTrrURI ( results . steeredProvider . uri ) ;
364
383
resultsForTelemetry . steeredProvider = results . steeredProvider . id ;
365
384
}
0 commit comments