Bidi: Fix control characters appearing in the window title on Windows
This commit is contained in:
parent
d22e6cde6b
commit
6d5ce578e4
1 changed files with 7 additions and 1 deletions
|
@ -80,7 +80,13 @@ var Zotero_Tabs = new function () {
|
|||
iconBackgroundImage: tab.iconBackgroundImage
|
||||
})));
|
||||
var { tab } = this._getTab(this._selectedID);
|
||||
document.title = (tab.title.length ? tab.title + ' - ' : '') + 'Zotero';
|
||||
let tabTitle = tab.title;
|
||||
if (Zotero.isWin) {
|
||||
// Windows displays bidi control characters as placeholders in window titles, so strip them
|
||||
// See https://github.com/mozilla-services/screenshots/issues/4863
|
||||
tabTitle = tabTitle.replace(/[\u2068\u2069]/g, '');
|
||||
}
|
||||
document.title = (tabTitle.length ? tabTitle + ' - ' : '') + 'Zotero';
|
||||
this._updateTabBar();
|
||||
// Hide any tab `title` tooltips that might be open
|
||||
window.Zotero_Tooltip.stop();
|
||||
|
|
Loading…
Reference in a new issue