Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

New MDN documentation about e10s Message Manager

161 views
Skip to first unread message

Chris Peterson

unread,
Apr 30, 2014, 7:08:33 PM4/30/14
to mozilla-dev-te...@lists.mozilla.org, Will Bamberg
Will Bamberg, a technical writer on the MDN team, just posted his big
rewrite of the MDN page about the e10s Message Manager. Other e10s
topics like CPOWs and add-on examples will be coming.

If you see any problems, just let Will know.. or you can just edit the
wiki. :)

https://developer.mozilla.org/en-US/docs/The_message_manager


chris

Sid Stamm

unread,
Jun 4, 2014, 6:47:51 PM6/4/14
to Chris Peterson, mozilla-dev-te...@lists.mozilla.org, Will Bamberg
This is really cool!

-Sid

Sid Stamm

unread,
Jun 4, 2014, 6:47:51 PM6/4/14
to Chris Peterson, mozilla-dev-te...@lists.mozilla.org, Will Bamberg
On 04/30/2014 04:08 PM, Chris Peterson wrote:

Frédéric Wang

unread,
Jan 6, 2015, 3:28:58 PM1/6/15
to mozilla-dev-te...@lists.mozilla.org, wbam...@mozilla.com
Dear all,

I'm working on bugs 619521, 648548 and 467729 to implement automatic
font download when missing glyphs are found in Web pages. In particular
I plan to write an add-on for Desktop platforms that could
rely on PackageKit to perform automatic installation via the system's
package manager (current source is
https://github.com/fred-wang/MissingFontsNotifier).

The current patches rely on the nsIObserver interface (for example when
the Web rendering engine detects a missing glyphs it sends a
"font-needed" message to inform observers). This works well with
SeaMonkey but not with Firefox e10s. After reading the MDN doc, it seems
that I need the following:

https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/The_message_manager#Loading_scripts_per_child_process
"This can be useful for addons to register categories, observers and
components in child processes."

Can someone please give details / examples on how to register such a
"font-needed" observer in the content process? Or perhaps I only need to
use the Frame Message Managers?

Thank you.
--
Frédéric Wang
maths-informatique-jeux.com/blog/frederic

Blake Kaplan

unread,
Jan 12, 2015, 8:47:35 PM1/12/15
to mozilla-dev-te...@lists.mozilla.org
Frédéric Wang <fred...@free.fr> wrote:
> Can someone please give details / examples on how to register such a
> "font-needed" observer in the content process? Or perhaps I only need to
> use the Frame Message Managers?

Hi Frederic,

Did you see
<https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/The_message_manager#Loading_scripts_per_child_process>?
The basic idea is that you register a frame script that, in turns, loads a
..jsm in the child process. That .jsm can register the "font-needed" observer
and continue using message managers to reply properly. I don't know off the
top of my head if there's any example code though.
--
Blake Kaplan

Frédéric Wang

unread,
Jan 13, 2015, 5:12:55 PM1/13/15
to Blake Kaplan, mozilla-dev-te...@lists.mozilla.org
Thanks Blake. Yes, that's the link I mentioned in my initial message.
However, I didn't find any example and haven't found time to do some
experiments to see if I understood this paragraph correctly. The
alternative would be to use the Frame Message Managers to register such
a frame script for each tab, which sounds less optimized (and I haven't
tried that yet either).

Le 13/01/2015 02:46, Blake Kaplan a écrit :
> Hi Frederic,
>
> Did you see
> <https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/The_message_manager#Loading_scripts_per_child_process>?
> The basic idea is that you register a frame script that, in turns, loads a
> ..jsm in the child process. That .jsm can register the "font-needed" observer
> and continue using message managers to reply properly. I don't know off the
> top of my head if there's any example code though.
>


--
Frédéric Wang
maths-informatique-jeux.com/blog/frederic

Frédéric Wang

unread,
Jan 13, 2015, 5:12:57 PM1/13/15
to Blake Kaplan, mozilla-dev-te...@lists.mozilla.org
Thanks Blake. Yes, that's the link I mentioned in my initial message.
However, I didn't find any example and haven't found time to do some
experiments to see if I understood this paragraph correctly. The
alternative would be to use the Frame Message Managers to register such
a frame script for each tab, which sounds less optimized (and I haven't
tried that yet either).

Le 13/01/2015 02:46, Blake Kaplan a écrit :
> Hi Frederic,
>
> Did you see
> <https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/The_message_manager#Loading_scripts_per_child_process>?
> The basic idea is that you register a frame script that, in turns, loads a
> ..jsm in the child process. That .jsm can register the "font-needed" observer
> and continue using message managers to reply properly. I don't know off the
> top of my head if there's any example code though.
>


--
Frédéric Wang
maths-informatique-jeux.com/blog/frederic

Blake Kaplan

unread,
Jan 15, 2015, 5:35:51 PM1/15/15
to mozilla-dev-te...@lists.mozilla.org
Hello again,

The code found at <https://github.com/mrbkap/e10sbug/tree/observer> implements
a toy extension that shows how to load an observer once per child process. In
your observer, you'll probably want to grab one of the message managers
(possibly the global one?) to communicate with the parent process instead of
simply logging to the console.

Also, if you're writing code for the browser, you'll be able to avoid having
to write some of the skeleton stuff that I had to add (since the browser
already registers all of its components and resources).

Let me know if you have any questions about the code.
Blake Kaplan

Frédéric Wang

unread,
Jan 22, 2015, 6:40:29 AM1/22/15
to mozilla-dev-te...@lists.mozilla.org, mrb...@gmail.com, Jonathan Kew
Le 15/01/2015 23:34, Blake Kaplan a écrit :

> Hello again,
>
> The code found at <https://github.com/mrbkap/e10sbug/tree/observer> implements
> a toy extension that shows how to load an observer once per child process.

Thank you very much for your example, Blake! I finally had time to try
it this morning and updated my work-in-progress addon to work with
Firefox nightly:

https://github.com/fred-wang/MissingFontsNotifier/commit/0d81595726c9af0a088a2296030e78d751043f6f

> In
> your observer, you'll probably want to grab one of the message managers
> (possibly the global one?) to communicate with the parent process instead of
> simply logging to the console.

I was not sure how to use the global message manager from the JSM (I got
an error when trying to create one). Instead I used the child/parent
process message manager, as suggested on MDN:

"The JSM can then use the child process message manager to exchange
messages with the parent process message manager."

>
> Also, if you're writing code for the browser, you'll be able to avoid having
> to write some of the skeleton stuff that I had to add (since the browser
> already registers all of its components and resources).
>

Currently, on desktop I only plan to do an add-on
(and perhaps Linux maintainers can make bundle it in a package as
discussed on https://bugzilla.mozilla.org/show_bug.cgi?id=467729).

On mobile platform, it would be interesting to have it directly in the
browser code. Jonathan Kew started to write a patch for Android:

https://bug648548.bugzilla.mozilla.org/attachment.cgi?id=8520633

However, last time I tried, it didn't seem to work anymore. Perhaps it's
the same issue as the one I experimented on Desktop. What would be the
way to properly register "font-needed" observer, here?


--
Frédéric Wang
maths-informatique-jeux.com/blog/frederic

0 new messages