joewalker/devtools-window — pull request #240 by harthur (2012-11-15 04:21:25+00:00)
Title: Create tool's iframe only when it's been selected, fix for #232

This fixes issue #232. After switching hosts, selecting a tool doesn't fire the iframe's `load` event. This caused a tool to appear blank because the tool's `build()` function was never called.

My guess is it's a bug caused by `swapFrameLoaders()`, I think it does something to child iframes after being swapped. I have no idea. But I found a work-around: create a tool's iframe when it's selected (previously we were creating all the iframes on toolbox load, then setting the `src` when the tool was selected).

Also patches up a test to test this.