🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.comp.software.thunderbird
Article #153

Re: Tip: Disable open on double click

#153
From: Paul
Date: Thu, 05 Nov 2026 19:43
105 lines
4986 bytes
On Thu, 11/5/2026 7:00 AM, T wrote:
> On 11/4/26 11:25 PM, Paul wrote:
>> In any case, there is no "3" in there. Doing that, relies
>> on some behavior, a behavior I haven't seen handled in source.
>> I don't know if there is a sanitizing code in there somewhere
>> for this, or not.
>>
>>     Paul
> 
> 
> Hi Paul,
> 
> According to my favorite SI, 3 is "unpublished".
> 
> -T

I downloaded the source, and looked for evidence of this.

When the preference is used, it is not in fact being sanitized.
The preference is not "coerced" internally for consumption.
The behavior you got, is a "behavior via negligence",
it's a fallthrough case which is not defined.

******************  ext-messageDisplay.js  ****************
/**
 * Check the users preference on opening new messages in tabs or windows.
 *
 * @returns {"tab"|"window"} - Either "tab" or "window".
 */
function getDefaultMessageOpenLocation() {
  const pref = Services.prefs.getIntPref("mail.openMessageBehavior");
  return pref == MailConsts.OpenMessageBehavior.NEW_TAB ? "tab" : "window";
}

I think that's checking whether the value is exactly "2" or not.
A value of "3" does not match, so it is going to use a window
for the job. How, or whether, it is in "existing windows" mode,
there is no function defined "near" that routine to set a boolean
for the purpose.

const MC.OpenMessageBehavior = {
  NEW_WINDOW: 0,
  EXISTING_WINDOW: 1,
  NEW_TAB: 2,
};

If we look at this

*********************** MailUtils.sys.mjs **************************

    const behaviorEnum = lazy.MailConsts.OpenMessageBehavior;
    switch (openMessageBehavior) {
      case behaviorEnum.NEW_WINDOW:
        this.openMessagesInNewWindows(aMsgHdrs, aViewWrapperToClone);
        break;
      case behaviorEnum.EXISTING_WINDOW:
        // Try reusing an existing window. If we can't, fall back to opening
        // new windows.
        if (
          aMsgHdrs.length > 1 ||
          !this.openMessageInExistingWindow(aMsgHdrs[0])
        ) {
          this.openMessagesInNewWindows(aMsgHdrs, aViewWrapperToClone);
        }
        break;
      case behaviorEnum.NEW_TAB:
        this.openMessageInNewTab(
          aMsgHdrs,
          aViewWrapperToClone,
          aTabmail,
          shiftPressed,
          forceTab
        );
        break;
    }
  },

it has no Default selection. A value of 3 will cause it
to not open the message at all.  It's not marked as such.
Neither do the test routines, check a value outside the
ENUM set, to determine whether "do nothing" is what happened.

There is no sanitizing, and this is "expected behavior" when it
comes to about:config. The rule is "you break it, you bought it"
with about:config. If you enter an illegal value manually (the
tool would not do this when you use an actual Preferences dialog),
then we cannot predict what would happen.

In this case, no variant of "this.openMessage" is involved
when the value is set to 3 (by a mischievous user and about:config).

So in fact, there is no sanitizing of the setting at all.
it does not return to the (default) value of 2, when the
value is out of range. Instead, the behavior is one of
a "no match with respect to ENUM set" and it doesn't
do anything.

I determined this, by downloading the source tarball, unpacking
it, and I used Agent Ransack content-search capability, to
see how many "test routines" versus "actual code" were involved.
Agent Ransack is significantly faster on the second search.
The first search (which might be loading everything into
the read cache), is pretty damn slow.

   Paul
Technical Details
Message-ID: <11cim8k$1u4hc$1@dont-email.me>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
References: <11cgvc0$196a6$1@dont-email.me> <11chb0n$1c8br$1@dont-email.me> <11chr4a$1j7mu$2@dont-email.me>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!eternal-september.org!feeder.eternal-september.org!nntp.eternal-september.org!.POSTED!not-for-mail
From: Paul <nospam@needed.invalid>
Newsgroups: alt.comp.software.thunderbird
Subject: Re: Tip: Disable open on double click
Date: Thu, 5 Nov 2026 14:43:17 -0500
Organization: A noiseless patient Spider
Lines: 105
Message-ID: <11cim8k$1u4hc$1@dont-email.me>
References: <11cgvc0$196a6$1@dont-email.me> <11chb0n$1c8br$1@dont-email.me>
 <11chr4a$1j7mu$2@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 05 Nov 2026 19:43:17 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2036268"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19xzHv6Ayp26O0Y6iBqrM7QbNbVljEMUAo="; posting-host="16536451042eaea8c9eb5b221b15f9f1"
User-Agent: THIS SPACE FOR RENT
Cancel-Lock: sha1:p54J2PmmGVcj2wcAApEo2RvaNCo= sha256:yyvB5HgKDIBfcYGHnH5g50yL/flQsOakc/blWlkeGw0=
	sha1:OVeDpFqjqn5eKEgb5LNcOVvnOiw= sha256:2UO5ZN+hCk5Nnk2tZG8bhY3nPCd6SdRS5pLl7Lh84r4=
In-Reply-To: <11chr4a$1j7mu$2@dont-email.me>
Content-Language: en-US