Fixed usage of gBrowser while window is not in scope.