mozilla/browserid — Issue #764: consider migrating to winchan
Author: lloyd
Created: 2011-12-16 03:19:21+00:00
State: open

[winchan][https://github.com/lloyd/winchan] is an abstraction around spawning cross domain windows, passing them parameters, and getting a response. We should consider moving over to it rather than our current implementation.

The benefits of winchan over the existing implementation may include:

* for upcoming primary support we will be able test new required features for window communication in isolation before integrating them
* we may be able to more easily isolate and test issues related to spawning and communication with spawned windows
* winchan removes the user visible fragment identifiers from the url of the spawned window
* winchan only uses a relay frame on platforms where it is required, which is slightly better on resource loading and has shown to simplify some of the spawning code.
* winchan functions without loading an iframe into the RP's document at page load time, which may avert some developer discomfort regarding perceived or real load time performance impact (removing two requests at RP page load time - DOM and script of relay frame)
* winchan should work well with native clients, as if the spawner is not themselves using winchan, the spawned dialog's onOpen call won't get hit and the spawner will be free to directly invoke the internal API

All this aside, this is fragile code and the implementation should be done on a branch, tested, and then be considered for merging.

/cc @benadida @shane-tomlinson