Keep getting "request blocked" at login

Nicholas Alexander nalexander at
Thu Jun 30 16:56:37 UTC 2016

Hi Gabriel,

On Thu, Jun 30, 2016 at 9:16 AM, Gabriel Ivașcu <ivascu.gabriel59 at>

> Hi,
> I'm writing again because, after looking at the WebChannel-related
> code, it seems to me that this is rather Mozilla-specific code and not
> so easily usable in other contexts.

This is only partially true.  See below.

> WebChannel.jsm [0] seems to be a JavaScript module that depends on
> other modules and those depend on other modules, winding up to some
> IDL files.
> Is there a way to import these modules in specific context other than
> Mozilla/Firefox or does the whole code need to be rewritten?

The "whole code need[s] to be rewritten", but it's really not as bad as it
looks.  The WebChannel stuff is just some browser-level abstraction around
a simple event passing model, and in fact you can opt out of it entirely
(at least for a while).  There's an example of doing the dance in a WebView
in the iOS repository.  You can start digging into the code at



The first link includes `service=sync&context=fx_ios_v1`; that'll ensure
the accounts service sends you the messages over postMessage.  The second
link shows how to inject the message listener into the WebView context, so
you can react to the messages.  The third link shows what we do with those
messages -- the important one is "login", which includes all the tokens
you'll need to talk to the auth server to get keys, etc.

This postMessage interface has been cleaned up and regularized into the
WebChannel interface, but the underlying mechanism is almost identical.
The browser bits are just an abstraction on top of that since we want to
use the same approach for many browser <-> content interactions.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Sync-dev mailing list