if (aWhere == 'current' && !isTabEmpty(gBrowser.selectedTab)) aWhere = 'tab';



let win = Services.wm.getMostRecentWindow("navigator:browser");
if (aWhere == 'current' && !win.isTabEmpty(win.gBrowser.selectedTab)) aWhere = 'tab';

(1行追加, 1行修正)とすればいい