为提升您的使用体验,本站正在维护,部分功能暂时无法使用。如果本站文章无法解决您的问题,您想要向社区提问的话,请到 Twitter 上的 @FirefoxSupport 或 Reddit 上的 /r/firefox 提问,我们的支持社区将会很快回复您的疑问。

搜索 | 用户支持

防范以用户支持为名的诈骗。我们绝对不会要求您拨打电话或发送短信,及提供任何个人信息。请使用“举报滥用”选项报告涉及违规的行为。

详细了解

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