Open Bug 1387425 Opened 7 years ago Updated 2 years ago

titlepreface is not applied to windows without titles on Windows

Categories

(Firefox :: Tabbed Browser, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: bsilverberg, Unassigned)

References

Details

This is a spin-off from bug 1333376. When testing that we noticed that, on Windows, when a titlepreface has been added to a window it does not get applied if the current document in the window does not have a title. On OS X, however, the titlepreface is applied to the window title even for windows whose current document has no title. I am guessing this has something to do with the code at [1], but I'm not sure why the behaviour is different on Windows than in is on OS X. [1] http://searchfox.org/mozilla-central/rev/30a47c4339bd397b937abdb2305f99d3bb537ba6/browser/base/content/tabbrowser.xml#1053-1058
We tested this on Linux as well and the behaviour is slightly different from that on OS X and from that on Windows. On Linux, if you assign a titlepreface to a Window with a current document without a title the preface is not applied, but if you reload the window the preface is applied. On Windows reloading the window does not cause the preface to be applied.
The bug can easily be reproduced on Linux with Firefox 56.0b7. 1- set a titlePreface e.g. "Blah -- " 2- open a webpage in a tab e.g. "https://www.mozilla.org/en-US/firefox/" 3- window's title is now "Blah -- A better, faster, private browser for today | Firefox - Mozilla Firefox" 4- open web console and type document.title="" 5- now window's title is "Mozilla Firefox" and preface is ignored.
(In reply to Fabien Givors from comment #2) > The bug can easily be reproduced on Linux with Firefox 56.0b7. > > 1- set a titlePreface e.g. "Blah -- " > 2- open a webpage in a tab e.g. "https://www.mozilla.org/en-US/firefox/" > 3- window's title is now "Blah -- A better, faster, private browser for > today | Firefox - Mozilla Firefox" > 4- open web console and type document.title="" > 5- now window's title is "Mozilla Firefox" and preface is ignored. The behaviour in 4-5 is expected. We are not changing the document.title of the web document - we are just changing the title of the Firefox window. This was discussed in bug 1333376. If you need to know what the current window title is, including the prefix, you can check the title property of the window object returned by the browser.windows API.
I thought that 5 should give "Blah -- Mozilla Firefox" instead of just "Mozilla Firefox" Doc says about titlePreface: "Use this to add a string to the beginning of the browser window's title. Depending on the underlying operating system, this might not work on browser windows that don't have a title (such as about:blank in Firefox)." Well, not working with about:blank is what this bug is about, and what I'm reproducing on Linux in comment 2, isn't it? Opening about:blank also causes the Preface to be ignored on Linux, as does blanking the title of an already opened document. So, the bug concern Linux as well as Windows.
Priority: -- → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.