<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<font face="Calibri">Well I am a little excited. </font><br>
<div class="moz-signature">“Against stupidity the gods themselves
contend in vain.”
<i>― Friedrich von Schiller, Die Jungfrau von Orleans </i></div>
<div class="moz-cite-prefix">On 20-Jan-21 8:25 PM, Geoff Lankow
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:60b4c3a4-3441-7f48-ddc8-0a6df36a01ce@thunderbird.net">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<p> </p>
<div class="moz-text-html" lang="x-unicode">
<p>I am pleased to announce that, unless something crazy
happens, the next Daily will use more than one process. This
builds on the work to make Firefox multi-process capable (AKA
the Electrolysis project) and is the result of my work over
the last few months.</p>
<p>Don't get too excited… this is more about enabling potential
improvements in the future than noticeable improvements now.<br>
</p>
</div>
<div class="moz-text-html" lang="x-unicode">
<h2>What has actually changed?</h2>
<ul>
<li>When Thunderbird loads a web page in the message pane
(such as the home page), or in a tab, or in a window, that
will be done by a secondary "child" process, not the main
Thunderbird process as was previously the case.</li>
<li>Transitioning from a web page to a message, or vice versa,
has become more complicated, but this is handled
automatically.<br>
</li>
<li>Extensions are now loaded in child processes.</li>
</ul>
<h2>What does this mean for me?</h2>
<h3>End-users:</h3>
<p>Users <i>should not</i> notice any changes. This change is
entirely in the background and shouldn't make any difference
to what the user interface does.<br>
</p>
<h3>Developers:</h3>
<p>This won't affect most of what developers are working on.
However if you need to do something with the contents of a web
page, your life just became more complicated. You'll need to
reach across the process boundary, probably using actors. This
may seem complicated compared to using <font face="monospace">contentDocument</font>
etc. but is pretty easy once you get the hang of it. The
Firefox docs have <a
href="https://firefox-source-docs.mozilla.org/dom/ipc/jsactors.html"
moz-do-not-send="true">some good information</a> or you can
ask me for help.</p>
<p>The same applies to tests looking at the content of web
pages. In most cases, <font face="monospace"><a
href="https://searchfox.org/mozilla-central/rev/c03e8de87cdb0ce0378c0886d3c0ce8bbf9dc44e/testing/specialpowers/content/SpecialPowersChild.jsm#1509-1545"
moz-do-not-send="true">SpecialPowers.spawn</a></font> will
be all you need.</p>
<p>When loading or changing URLs in a <font face="monospace"><browser></font>
element, please use <font face="monospace">MailE10SUtils.loadURI</font>.
This will handle the transition between parent and child
processes, if necessary.<br>
</p>
<p>One other thing to note is that the "content" tab type has
changed. Where once you would open a content tab and specify
how clicks on links in that tab should behave, this now
happens automatically. By default links to URLs on the same
website will open in Thunderbird and all others in an external
browser, but you can make this more restrictive (only URLs on
the same page) or less restrictive (any URLs). See the JSDoc
on <font face="monospace">specialTabs.contentTabType.openTab</font>
for details.<br>
</p>
<h3>Extension developers:</h3>
<p>You might notice some changes, depending on what your
extension does.<br>
</p>
<ul>
<li>If it's wholly a WebExtension (no experiments) it should
just work as before.</li>
<li>Experiments run in the main "parent" process, just like
they did before. Most things should continue working, unless
you're reaching into web pages (which you shouldn't need to
because the <font face="monospace"><a
href="https://webextension-api.thunderbird.net/en/latest/tabs.html#executescript-tabid-details"
moz-do-not-send="true">tabs.executeScript</a></font>
function and friends exist).</li>
<li>If you open tabs using an experiment you should read about
the changes above. And probably think about moving to <font
face="monospace"><a moz-do-not-send="true"
href="https://webextension-api.thunderbird.net/en/latest/tabs.html#create-createproperties">tabs.create</a></font>.<br>
</li>
</ul>
<h2>When will this happen?</h2>
<p>I've <i>just</i> landed the changes. They'll be in the next
Daily build. Unless something serious happens, I expect they
will be in 86 beta 1 next week, and then in 2021's ESR.<br>
</p>
<h2>Can I turn it off?</h2>
<p>If you must, yes, technically it will be possible to return
to using a single process. However, it's not possible to run
our automated testing on both single-process and multi-process
Thunderbird at the same time, so the default will be
multi-process.<br>
</p>
<p>The preferences to change are <font face="monospace">browser.tabs.remote.autostart</font>
and <font face="monospace">extensions.webextensions.remote</font>.
Set them to false to go back to single-process.<br>
</p>
<h2>What will happen in the future?</h2>
<p>While the changes I've made today don't do a lot, it does
bring us a lot closer to what Firefox does so we can take
advantage of what they have been working on for the last few
years. (It also means there should be fewer problems caused by
the differences between our code and theirs.)</p>
<p>I haven't really looked into what could now be possible, but
theoretically it should allow us to move things out of the
main process for performance and security advantages. For
example, loading network calendars or CardDAV address books
should be possible in a child process. Potentially we could
move mail operations to another process (don't hold your
breath).<br>
</p>
<h2>What should I do if I find a bug?<br>
</h2>
<p>Report bugs as per usual, and if you're convinced today's
changes are the cause, mark as regressed by <a
href="https://bugzilla.mozilla.org/show_bug.cgi?id=1646648"
moz-do-not-send="true">bug 1646648</a>. If you're not
convinced of the cause but suspicious, CC/NI me and ask.</p>
<p>GL<br>
</p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
tb-planning mailing list
<a class="moz-txt-link-abbreviated" href="mailto:tb-planning@mozilla.org">tb-planning@mozilla.org</a>
<a class="moz-txt-link-freetext" href="https://mail.mozilla.org/listinfo/tb-planning">https://mail.mozilla.org/listinfo/tb-planning</a>
</pre>
</blockquote>
<br>
</body>
</html>