🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Tip: Disable open on double click

#155
From: T
Date: Thu, 05 Nov 2026 20:32
111 lines
5372 bytes
On 11/5/26 11:43 AM, Paul wrote:
> 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


Have you thought of trying it out on your own computer
to see what happens?
Technical Details
Message-ID: <11cip4n$1v82o$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> <11cim8k$1u4hc$1@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: T <T@invalid.invalid>
Newsgroups: alt.comp.software.thunderbird
Subject: Re: Tip: Disable open on double click
Date: Thu, 5 Nov 2026 12:32:23 -0800
Organization: A noiseless patient Spider
Lines: 111
Message-ID: <11cip4n$1v82o$1@dont-email.me>
References: <11cgvc0$196a6$1@dont-email.me> <11chb0n$1c8br$1@dont-email.me>
 <11chr4a$1j7mu$2@dont-email.me> <11cim8k$1u4hc$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Thu, 05 Nov 2026 20:32:24 +0000 (UTC)
Injection-Info: dont-email.me;
	logging-data="2072664"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1+hKBaJenDC31TVYqqj3XyBFlKcC1qVviA="; posting-host="50d167082654a7d32fb91734b98c4a0d"
User-Agent: Betterbird (Linux)
Cancel-Lock: sha1:QfS9Y69nAplzf1jZEJl8joBjkSQ= sha256:w+YZfXBtjf5QWNkqCucwsDBLIGFHVsuZZFyFgHpSBF4=
	sha1:V0zCDXlawLsATXx1w4zwrOnU+pA= sha256:WbFFlIiJQJq2VgK5hM4CHINyWJC5Qm3KeoEh/vT5k00=
In-Reply-To: <11cim8k$1u4hc$1@dont-email.me>
Content-Language: en-US