From 6d5ce578e430380b633c4e8a32898ab4975dfa2e Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Fri, 7 Apr 2023 13:50:15 -0400 Subject: [PATCH] Bidi: Fix control characters appearing in the window title on Windows --- chrome/content/zotero/tabs.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/tabs.js b/chrome/content/zotero/tabs.js index 250f461dc9..9b49f4e984 100644 --- a/chrome/content/zotero/tabs.js +++ b/chrome/content/zotero/tabs.js @@ -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();