diff --git a/extension/components/scriptish.js b/extension/components/scriptish.js index 966a4800..3704b6ef 100644 --- a/extension/components/scriptish.js +++ b/extension/components/scriptish.js @@ -81,7 +81,8 @@ ScriptishService.prototype = { let currentInnerWindowID = getInnerId(safeWin); // if the focused tab's window is the one loading, then attach menuCommander - if (safeWin === gBrowser.selectedBrowser.contentWindow) { + if (gBrowser && gBrowser.selectedBrowser && + safeWin === gBrowser.selectedBrowser.contentWindow) { if (gmBrowserUI.currentMenuCommander) gmBrowserUI.currentMenuCommander.detach();