"general.appname.override" pref is ignored (Firefox 25 regression)

VERIFIED FIXED in Firefox 26

Status

()

defect
VERIFIED FIXED
6 years ago
4 months ago

People

(Reporter: am5050, Assigned: longsonr)

Tracking

({regression})

25 Branch
mozilla28
Points:
---
Dependency tree / graph
Bug Flags:
in-testsuite +

Firefox Tracking Flags

(firefox26 verified, firefox27 verified, firefox28 verified, b2g-v1.2 fixed)

Details

Attachments

(1 attachment)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/32.0.1678.0 Safari/537.36

Steps to reproduce:

Set "general.appname.override" pref to "Hello", then visited a test page that reports the value of navigator.appName.


Actual results:

navigator.appName = "Netscape"


Expected results:

navigator.appName = "Hello"

This was caused by a changeset for https://bugzilla.mozilla.org/show_bug.cgi?id=838146

https://hg.mozilla.org/mozilla-central/rev/7c7ef42d1fe1

general.appname.override no longer is honored due to the removal of the return:

   1.714 -nsresult
   1.715 +void
   1.716  NS_GetNavigatorAppName(nsAString& aAppName)
   1.717  {
   1.718    if (!nsContentUtils::IsCallerChrome()) {
   1.719      const nsAdoptingString& override =
   1.720        mozilla::Preferences::GetString("general.appname.override");
   1.721  
   1.722      if (override) {
   1.723        aAppName = override;
   1.724 -      return NS_OK;
   1.725      }
   1.726    }
   1.727  
   1.728    aAppName.AssignLiteral("Netscape");
   1.729 -  return NS_OK;
   1.730  }
Blocks: 838146
Keywords: regression
OS: Mac OS X → All
Hardware: x86 → All
Assignee: nobody → longsonr
Posted patch patchSplinter Review
Component: Untriaged → DOM
Product: Firefox → Core
Attachment #8333558 - Flags: review?(bugs)
Status: UNCONFIRMED → NEW
Ever confirmed: true
Attachment #8333558 - Flags: review?(bugs) → review+
Thanks for the pointer to the code to fix Adam.

https://hg.mozilla.org/integration/mozilla-inbound/rev/56791576d790
Flags: in-testsuite+
https://hg.mozilla.org/mozilla-central/rev/56791576d790
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Robert, thanks for picking this up!  Should we get this backported?
Duplicate of this bug: 942533
I've hit this bug with one app which where testing IE browser using !navigator.appName!="netscape" method and I was not able to bypass it using a plugin.

+1
Please backport it.
Comment on attachment 8333558 [details] [diff] [review]
patch

[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 838146
User impact if declined: At least one extension uses this: https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/reviews/
Testing completed (on m-c, etc.):  landed on m-c with a test some time ago.
Risk to taking this patch (and alternatives if risky): low, it's only one line.
String or IDL/UUID changes made by this patch: none
Attachment #8333558 - Flags: approval-mozilla-beta?
Attachment #8333558 - Flags: approval-mozilla-aurora?
Attachment #8333558 - Flags: approval-mozilla-beta?
Attachment #8333558 - Flags: approval-mozilla-beta+
Attachment #8333558 - Flags: approval-mozilla-aurora?
Attachment #8333558 - Flags: approval-mozilla-aurora+
Keywords: checkin-needed
Whiteboard: needs landing on beta/aurora using hg qimport
Keywords: verifyme
I have modified the pref and then ran the script from 
http://www.w3schools.com/jsref/tryit.asp?filename=tryjsref_nav_appname. The navigator.appName was the configured pref or Netscape if the pref wasn't set.

Verified using Fx 26 beta 8 (20131125215016), latest Aurora (20131126004001), latest Nightly (20131126030201) on Win 7 64-bit, Ubuntu 13.04 32-bit and Mac OS 10.8.5. 
Considering that the issue is also covered by automated tests, I'm marking these versions as verified.
Removing the "verifyme" keyword as per Comment 10.
Status: RESOLVED → VERIFIED
Keywords: verifyme
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.