This is a followup to bug 255372. See especially bug 255372 comment 95. Right now we set the chromehidden attribute way too late, after we've constructed frames and loaded images for all the chrome that's going to be hidden. This has two problems: 1. We do a lot of extra work 2. As long as onload is fired synchronously, we're breaking a bunch of invariants by modifying the document in the middle of code that depends on the document not being modified. This can cause crashes like bug 255372.
*** This bug has been marked as a duplicate of 345560 ***