eyalroz / bidimailui

BiDi Mail UI: Thunderbird extension for improved right-to-left language support
https://addons.thunderbird.net/en-US/thunderbird/addon/bidi-mail-ui/
Other
19 stars 2 forks source link

Getting messageEditor.contentDocument is null #121

Closed eyalroz closed 3 months ago

eyalroz commented 3 months ago

Sometimes, when replying to a message, and possibly switching between the body and the subject (or not) or the addresses area (or not) - it is impossible to change the (text) message direction using the mail-toolbar icons. The message you get is:

An error occurred executing the cmd_ltr_document command: TypeError: messageEditor.contentDocument is null globalOverlay.js:102:13

and the icon state remains the same. Using "Switch Message Direction" in the context menu gives us:

An error occurred executing the cmd_switch_document command: TypeError: BiDiMailUI.getMessageEditor(...).contentDocument is null globalOverlay.js:102:13

Using the Developer Console, it seems the editor element's contentDocument is not null, however.

The editor element outer XML is:

<editor 
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" 
  id="messageEditor"
  type="content" 
  primary="true"
  src="about:blank?" 
  name="browser.message.body" 
  aria-label="Message body"
  messagemanagergroup="browsers"
  oncontextmenu="this._contextX = event.clientX; this._contextY = event.clientY;" 
  onclick="EditorClick(event);"
  ondblclick="EditorDblClick(event);"
  context="msgComposeContext" 
  editortype="textmail"
/>
eyalroz commented 3 months ago

Can't reproduce this situation right now. Will reopen if I see it again.