$' is replaced to Mozilla Firefox in titles
Categories
(Firefox :: Tabbed Browser, defect)
Tracking
()
People
(Reporter: mzfilin, Assigned: Gijs)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
329.46 KB,
image/png
|
Details | |
48 bytes,
text/x-phabricator-request
|
jcristau
:
approval-mozilla-release+
|
Details | Review |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0
Steps to reproduce:
Follow this link and look to the title: https://stackoverflow.com/questions/36587660/in-a-bash-script-what-would-0-evaluate-to-and-why
Actual results:
In page titles $' is replaced to "Mozilla Firefox". Sometimes it is really annoying. For example: https://stackoverflow.com/questions/36587660/in-a-bash-script-what-would-0-evaluate-to-and-why
Expected results:
$' should have left as-is.
Comment 1•4 years ago
|
||
Bugbug thinks this bug should belong to this component, but please revert this change in case of error.
Comment 2•4 years ago
|
||
I can repro, and this is done from JS code:
Thread 1 hit Breakpoint 2, mozilla::dom::Document::SetTitle (this=0x7f23203d4000, aTitle=..., aRv=...) at /home/emilio/src/moz/gecko-2/dom/base/Document.cpp:8610
8610 Element* rootElement = GetRootElement();
(rr) p aTitle
$9 = (const nsAString &) @0x7fff177ea058: {<mozilla::detail::nsTStringRepr<char16_t>> = {mData = 0x7f230dd91248 u"1686907 - — Nightly is replaced to Mozilla Firefox in titles — Nightly", mLength = 71,
mDataFlags = (mozilla::detail::StringDataFlags::TERMINATED | mozilla::detail::StringDataFlags::REFCOUNTED), mClassFlags = mozilla::detail::StringClassFlags::INLINE}, }
(rr) p DumpJSStack()
0 updateTitlebar() ["chrome://browser/content/tabbrowser.js":981:28]
this = [object Object]
1 _setTabLabel(aTab = "[object XULElement]", aLabel = ""1686907 - $' is replaced to Mozilla Firefox in titles"", (destructured parameter) = "[object Object]") ["chrome://browser/content/tabbrowser.js":1539:13]
this = [object Object]
2 setTabTitle(aTab = "[object XULElement]") ["chrome://browser/content/tabbrowser.js":1501:18]
this = [object Object]
3 _setupEventListeners/<(event = "[object Event]") ["chrome://browser/content/tabbrowser.js":5352:32]
$10 = void
Comment 3•4 years ago
|
||
Not a recent regression, happens in firefox 80 at least.
Comment 4•4 years ago
|
||
77 is good, I bisected a bit more and stoped at:
Because bug 1626842 is in the range and I'm almost sure that's the cause. Gijs, can you take a look?
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
Huh, JavaScript: "CONTENTTITLE -- Foobar".replace("CONTENTTITLE", '$\'')
is -- Foobar -- Foobar
, lol
Assignee | ||
Comment 6•4 years ago
|
||
(In reply to Emilio Cobos Álvarez (:emilio) from comment #5)
Huh, JavaScript:
"CONTENTTITLE -- Foobar".replace("CONTENTTITLE", '$\'')
is-- Foobar -- Foobar
, lol
Comment 7•4 years ago
|
||
title = title.replaceAll("$", "$$$$")
I guess? :-)
Assignee | ||
Comment 8•4 years ago
|
||
I should really have remembered because one of my first Mozilla-related patches involved that construct.
In my defense, that was 16 years ago.
(In reply to Emilio Cobos Álvarez (:emilio) from comment #7)
title = title.replaceAll("$", "$$$$")
I guess? :-)
There's a more elegant option, I think:
title = foo.replace("CONTENTTITLE", () => title);
Will need a comment, of course...
Assignee | ||
Comment 9•4 years ago
|
||
Assignee | ||
Comment 10•4 years ago
|
||
Comment on attachment 9197354 [details]
Bug 1686907 - fix the window title being affected by JS's 'replace' API treating dollar signs as 'special', r?emilio
Beta/Release Uplift Approval Request
- User impact if declined: Confusing window titles
- Is this code covered by automated tests?: No
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: Yes
- If yes, steps to reproduce: See webpage from comment 0 (or use this bug) and check the window title contains a dollar sign followed by a single quote (and doesn't contain the brand name several times)
Note that this bug occurs only on Windows and Linux
- List of other uplifts needed: nope
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): Trivial change to a
replace
call to avoid silly JS behaviour in how it uses the replacement string - String changes made/needed: nope
Assignee | ||
Updated•4 years ago
|
Comment 11•4 years ago
|
||
Comment 12•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Comment 13•4 years ago
|
||
This issue is Verified as Fixed in our latest Nightly build 86.0a1 (2021-01-17) on Windows 10 and Ubuntu 18.04.
Updated•4 years ago
|
Updated•4 years ago
|
Comment 14•4 years ago
|
||
Comment on attachment 9197354 [details]
Bug 1686907 - fix the window title being affected by JS's 'replace' API treating dollar signs as 'special', r?emilio
approved for 85 rc1
Comment 15•4 years ago
|
||
bugherder uplift |
Comment 16•4 years ago
|
||
This issue is Verified as Fixed in our latest Release Candidate 85.0 on Windows 10 and Ubuntu 18.04.
Updated•4 years ago
|
Comment 17•3 years ago
|
||
Removing qe+ flag as it was verified in Comment 16
Description
•