This site will have limited functionality while we undergo maintenance to improve your experience. If an article doesn't solve your issue and you want to ask a question, we have our support community waiting to help you at @FirefoxSupport on Twitter and/r/firefox on Reddit.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Is there a way to make it so that when there is only one tab open that there is no x button on the tab?

  • 4 replies
  • 2 have this problem
  • 1 view
  • Last reply by matt7425

more options

I just updated from version 21, were when there was only one tab open there was no x on the tab to close it, but now on version 48 there is a x button. I tried searching for this but could only find about:config page: browser.tabs.closeWindowWithLastTab = false, but this only sets the x button to close the tab. I want to get rid of the x button all together when there is only one tab left.

I just updated from version 21, were when there was only one tab open there was no x on the tab to close it, but now on version 48 there is a x button. I tried searching for this but could only find about:config page: browser.tabs.closeWindowWithLastTab = false, but this only sets the x button to close the tab. I want to get rid of the x button all together when there is only one tab left.

Chosen solution

Many aspects of Firefox's interface can be modified with custom style rules. Firefox marks the first and last tabs in the window with a special attribute (first-tab and last-tab), so you can use that to style a tab that is both the first and last tab, in other words, the only tab, and hide the button.

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
.tabbrowser-tab[first-tab="true"][last-tab="true"] .tab-close-button {
  display:none !important;
}

You can apply custom style rules to Firefox's interface using either:

I prefer Stylish because it's easy to test/preview the results and adjust the rule. However, if you do not want to add any more extensions, then userChrome.css might work better for you.

If you are using Stylish:

(1) Install Stylish and use the displayed link to restart Firefox to complete the activation

(2) Click the add-on's "S" button on the toolbar, then Write new style, then Blank style (if the S button does not appear, or you don't want another button on the toolbar, you can go to the Add-ons page, click User Styles in the left column, then use the Write New Style button on that page)

(3) In the editing window that opens, in the large box next to the 1, paste the rule

(4) Click the Preview button to apply the rule, then move the new rule to its own window so it's the only tab by right-clicking the tab and choosing Move to New Window -- the little x should disappear

(5) If it's working, enter a name in the space above the rule like Hide Close Button on Last Tab and click Save. You're done.

If it's not working, hmm, we'll have to figure out why.

Read this answer in context 👍 0

All Replies (4)

more options

There is one way. Put it in full screen mode.

more options

anf25 said

There is one way. Put it in full screen mode.

I don't want to always have to be in full screen mode, also I just tried and it didn't even work.

more options

Chosen Solution

Many aspects of Firefox's interface can be modified with custom style rules. Firefox marks the first and last tabs in the window with a special attribute (first-tab and last-tab), so you can use that to style a tab that is both the first and last tab, in other words, the only tab, and hide the button.

@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
.tabbrowser-tab[first-tab="true"][last-tab="true"] .tab-close-button {
  display:none !important;
}

You can apply custom style rules to Firefox's interface using either:

I prefer Stylish because it's easy to test/preview the results and adjust the rule. However, if you do not want to add any more extensions, then userChrome.css might work better for you.

If you are using Stylish:

(1) Install Stylish and use the displayed link to restart Firefox to complete the activation

(2) Click the add-on's "S" button on the toolbar, then Write new style, then Blank style (if the S button does not appear, or you don't want another button on the toolbar, you can go to the Add-ons page, click User Styles in the left column, then use the Write New Style button on that page)

(3) In the editing window that opens, in the large box next to the 1, paste the rule

(4) Click the Preview button to apply the rule, then move the new rule to its own window so it's the only tab by right-clicking the tab and choosing Move to New Window -- the little x should disappear

(5) If it's working, enter a name in the space above the rule like Hide Close Button on Last Tab and click Save. You're done.

If it's not working, hmm, we'll have to figure out why.

more options

jscher2000 said

Many aspects of Firefox's interface can be modified with custom style rules. Firefox marks the first and last tabs in the window with a special attribute (first-tab and last-tab), so you can use that to style a tab that is both the first and last tab, in other words, the only tab, and hide the button.
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
.tabbrowser-tab[first-tab="true"][last-tab="true"] .tab-close-button {
  display:none !important;
}

You can apply custom style rules to Firefox's interface using either:

I prefer Stylish because it's easy to test/preview the results and adjust the rule. However, if you do not want to add any more extensions, then userChrome.css might work better for you.

If you are using Stylish:

(1) Install Stylish and use the displayed link to restart Firefox to complete the activation

(2) Click the add-on's "S" button on the toolbar, then Write new style, then Blank style (if the S button does not appear, or you don't want another button on the toolbar, you can go to the Add-ons page, click User Styles in the left column, then use the Write New Style button on that page)

(3) In the editing window that opens, in the large box next to the 1, paste the rule

(4) Click the Preview button to apply the rule, then move the new rule to its own window so it's the only tab by right-clicking the tab and choosing Move to New Window -- the little x should disappear

(5) If it's working, enter a name in the space above the rule like Hide Close Button on Last Tab and click Save. You're done.

If it's not working, hmm, we'll have to figure out why.

This worked, thanks for the help ^^