Created attachment 8590899 [details] [diff] [review] browsertestutils-switchtab Two methods are added, which I've used to fix a bunch of tests. BrowserTestUtils.switchTab switches to a tab and waits for it to be ready. Currently, this is done using the TabSwitchDone event which fires after the tab switch has finished. BrowserTestUtils.openNewForegroundTab opens a new foreground tab and waits for it to be ready, and optionally, loaded. Unlike withNewTab, it doesn't close the tab, which I updated to call openNewForegroundTab.