Where did you install Firefox from? Help Mozilla uncover 3rd party websites that offer problematic Firefox installation by taking part in our campaign. There will be swag, and you'll be featured in our blog if you manage to report at least 10 valid reports!

搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

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 回覆
  • 2 有這個問題
  • 1 次檢視
  • 最近回覆由 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.

被選擇的解決方法

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.

從原來的回覆中察看解決方案 👍 0

所有回覆 (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

選擇的解決方法

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 ^^