Closed Bug 1722888 Opened 3 years ago Closed 3 years ago

Allow BrowserTestUtils to handle https-first upgraded loads

Categories

(Core :: DOM: Security, task, P1)

task

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: ckerschb, Assigned: ckerschb)

References

(Blocks 1 open bug)

Details

(Whiteboard: [domsecurity-active])

Attachments

(1 file)

No description provided.
Assignee: ckerschb → lyavor

stealing that back...

Assignee: lyavor → ckerschb
Pushed by mozilla@christophkerschbaumer.com: https://hg.mozilla.org/integration/autoland/rev/b8bc6abded4a Allow BrowserTestUtils to handle https-first upgraded loads r=Gijs

Backed out for causing bc failures on browser_preferences_usage.js.

Push with failures

Failure log

Backout link

Flags: needinfo?(ckerschb)

Gijs, do you think it would just work if we refactor the code to do something like if (wantLoad.startsWith("http://") and then nested within that if we do the getBoolPref so the pref is queried less often? As far as I can tell this is why the patch was backed out, because the pref is accessed too many times - or is there a better alternative in JS to cache the pref value?

Flags: needinfo?(ckerschb) → needinfo?(gijskruitbosch+bugs)

(In reply to Christoph Kerschbaumer [:ckerschb] from comment #5)

Gijs, do you think it would just work if we refactor the code to do something like if (wantLoad.startsWith("http://") and then nested within that if we do the getBoolPref so the pref is queried less often? As far as I can tell this is why the patch was backed out, because the pref is accessed too many times - or is there a better alternative in JS to cache the pref value?

XPCOMUtils.defineLazyPreferenceGetter(
  BrowserTestUtils,
  "_httpsFirstEnabled",
  "dom.security.https_first",
  false
);

after the definition of BrowserTestUtils in the jsm.

Then just check if (BrowserTestUtils._httpsFirstEnabled && wantLoad.startsWith("http://")) in the isWanted function.

Flags: needinfo?(gijskruitbosch+bugs)
Pushed by mozilla@christophkerschbaumer.com: https://hg.mozilla.org/integration/autoland/rev/ba883fb40bed Allow BrowserTestUtils to handle https-first upgraded loads r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: