Open Bug 1705326 Opened 4 years ago Updated 3 years ago

navigator.userAgent still returns custom UA after clearing browsingContext.customUserAgent if a reload happened while the custom UA was set

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

People

(Reporter: nchevobbe, Unassigned)

Details

Attachments

(1 obsolete file)

Steps to reproduce

  1. On a non data url document
  2. execute browsingContext.customUserAgent = "custom"
  3. reload the page (navigator.userAgent does return "custom")
  4. execute browsingContext.customUserAgent = "" to clear the custom user agent
  5. Evaluate navigator.userAgent in the page

Expected results

I get the initial UA value

Actual results

I still get the custom user agent value


That's seemed to be caused by retrieving the UA from the User-Agent header (https://searchfox.org/mozilla-central/rev/0b90e582d2f592a30713bafc55bfeb0e39e1a1fa/dom/base/Navigator.cpp#2024-2031)

https://phabricator.services.mozilla.com/D112159 modifies docshell/test/browser/browser_ua_emulation.js to demonstrate the issue

Farre, can you set the severity and priority on this one, please?

Flags: needinfo?(afarre)
Severity: -- → S3
Flags: needinfo?(afarre)
Priority: -- → P3
Attachment #9216024 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: