@@ -204,14 +204,14 @@ const Tabs = Module("tabs", {
204204 * 1 - Focus the tab to the right of the remove tab.
205205 * 0 - Focus the altanate tab of the remove tab. if alternate tab is none, same as 1
206206 * -1 - Focus the tab to the left of the remove tab.
207- * @param {number } quitOnLastTab Whether to quit if the tab being
207+ * @param {number } forceQuitOnLastTab Whether to quit if the tab being
208208 * deleted is the only tab in the tab list:
209209 * 1 - quit without saving session
210210 * 2 - quit and save session
211211 * @param {boolean } force Close even if the tab is an app tab.
212212 */
213213 // FIXME: what is quitOnLastTab {1,2} all about then, eh? --djk
214- remove : function ( tab , count , orientation , quitOnLastTab , force ) {
214+ remove : function ( tab , count , orientation , forceQuitOnLastTab , force ) {
215215 let vTabs = config . tabbrowser . visibleTabs ;
216216 let removeOrBlankTab = {
217217 Firefox : function ( tab ) {
@@ -239,11 +239,14 @@ const Tabs = Module("tabs", {
239239 if ( typeof count != "number" || count < 1 )
240240 count = 1 ;
241241
242- if ( quitOnLastTab >= 1 && config . tabbrowser . mTabs . length <= count ) {
242+ if ( options . getPref ( "browser.tabs.closeWindowWithLastTab" ) && ! forceQuitOnLastTab )
243+ forceQuitOnLastTab = 1 ;
244+
245+ if ( forceQuitOnLastTab >= 1 && config . tabbrowser . mTabs . length <= count ) {
243246 if ( liberator . windows . length > 1 )
244247 window . close ( ) ;
245248 else
246- liberator . quit ( quitOnLastTab == 2 ) ;
249+ liberator . quit ( forceQuitOnLastTab == 2 ) ;
247250
248251 return ;
249252 }
0 commit comments