Trust me, it is broken in both versions. You may see different symptoms in different circumstances due to changes in things like which documents get remoted. I haven’t looked into it in detail, but if you have a lot of time on your hands feel free to dig into why you can sometimes get away with it You should be able to easily demonstrate problems in either version by opening several windows and seeing how many frame script messages you get.
I had a quick look at the actual code and spotted something else that you should probably change. All the frame script loading and message listeners would be much more reliable after the window load event fires. I guess it kind of works now or you wouldn’t have got this far, but there is no guarantee that it will always work, or even that it will work now on all platforms or simply in different installs. For example, there is no guarantee that the window global has a messageManager property that early (hint, use it for loading the frame scripts). Or it might work now and break tomorrow. The same for everything else really, you are riding your luck doing anything before that window load event. Sometimes it will work, then sometimes it will break and you’ll be killing yourself trying to work out why.