Matthias Schoettle

PhD Student & Software Developer

Firefox close tab button on hover

There are probably extensions that allow to do that, however, this is not necessary as I will show in this post. Maybe you’ve seen the functionality in Safari or just wondered why the close button for tabs in Firefox can’t just always be there. In Safari, the close button appears when hovering over the tab itself.

The following modification adds this functionality to Firefox. You need to create a file called userChrome.css with the following content:

.tabbrowser-tab:not([selected]) .tab-close-button {
        visibility: hidden !important;
        margin-left: -16px !important;
}

.tabbrowser-tab:not([selected]):hover .tab-close-button {
        visibility: visible !important; 
        margin-left: 0px !important;
}

Place this file into the chrome folder inside your profile’s directory. Follow the directions from Mozilla to find out where to find the profile’s directory location.

Update: It just tried this again myself due to a fresh installation and you also need to change the browser.tabs.tabClipWidth preference from it’s default value (140) to 99.

Then just restart Firefox and you are done.

Source: Post on Neowin Forums

1 Comment

  1. Thanks, still working 🙂

Leave a Reply

Your email address will not be published.

*

© 2017 Matthias Schoettle

Theme by Anders NorenUp ↑