Tab Limit

What is Tab Limit?

A simple extension to limit the number of tabs open in Safari.

If you try to open too many tabs (above the “Tab Limit”), Tab Limit will automatically close the left-most (non-“safe”) tab.

This keep your browser windows uncluttered, memory use and resume times low.

Tab Limit has two configurable options:

a) Maximum number of tabs per window (Tab Limit)

b) Number of left-most tabs to keep (Safe Tabs)

What are “Safe tabs”?

If you try to open a new tab, once the Tab Limit is reached, the extension will silently and automatically close a tab, to keep the number of open tabs at the Tab Limit. By default, the left-most tab is closed. If you want some tabs to be permanent, and safe from automatic closure, increase the number of Safe Tabs  (option b). The safe tabs are tabs which will never auto-close, instead the first tab to the right of the Safe Tabs, will be closed.

The safe tabs are always the left-most tabs in a window. You can rearrange tabs in Safari to choose which tabs are safe.


Download the extension here.

Credits: This extension was inspired by the No More Tabs extension in Chrome. This is my first Safari Extension and I found the public source of the OpenAtEnd extension very helpful in getting started. Thanks to Scott Jangro at for beta testing, suggesting the “Safe Tabs” feature and providing a very useful site.

Warning: This extension will close tabs silently and without requiring a confirmation!

The extension may not be compatible with other extensions which manipulate tabs, but it is compatible with  OpenAtEnd.


I recommend that you use OpenAtEnd in conjunction with Tab Limit. Then the tab which auto closes will (usually) be the oldest tab…

Please leave feedback in the comments below.


About Dan Browne

I hope you find these extensions useful. They were written in my spare time for my own use, and to get some javascript practise. They are working great for me, but let me know in the comments if you have any problems.
This entry was posted in Safari Extension. Bookmark the permalink.

8 Responses to Tab Limit

  1. Andy says:

    Tab Limit starts from a good idea, but IMO the “without warning” part is a VERY BAD idea.
    I often keep tabs opened as reminder of things to read or re-read later. If a tab closes, I will likely forget of that thing, maybe forever.

    Imagine doing “Re-open all windows from last session” by mistake, and one may likely loose all the current tabs and windows! So I think an optional warning should be there with possibility to cancel out.

    I have a SUGGESTION: A simple Tab counter in the toolbar -> How many tabs are currently opened! (with possible highlight when [number of tabs] > Threshold).

    I need to know how many tabs I have opened, so I can police myself. Prior to Lion, I used to pretend I was going to Quit Safari (then cancel) just to have that warning display telling me how many tabs were going to get closed. This is no longer available.
    The activity window provides some idea of how many tabs are there, but in my case, I often have more than 100 tabs opened, so I can’t possibly count them there. I have sometimes reached 250 tabs opened and I wish I had a warning to stop before then.

    Another suggestion, for Tab limit: If tabs must close without warning, then closed tabs could be added to the reading list, so there would not be lost!

  2. Dan Browne says:

    Thanks for this feedback Andy.

    I deliberately designed TabLimit to be unobtrusive to my workflow, and the omission of warning dialogues is deliberate. Nevertheless, warning boxes may indeed be useful for some users, so I’ll consider adding an option for them in the next version of Tab Limit.

    I like your other suggestions very much, and I’ll look into whether they are possible in the Safari API.

    I had planned to rewrite the extension for compatibility with Mountain Lion, but at present, it seems that the extension is already fully compatible with Safari 5.2, and requires no changes!

    Still, I’ll probably take a fresh look at the code before too long.

    • Dave says:

      Love how Tab Limit works, it is just what I was looking for. Unfortunately, it crashes Safari on Mavericks frequently. If you could update it to run properly on Mavericks and put it in the App Store, I would buy it in a minute.

  3. Jésus says:

    I want it but the link is broken bro. 😦

  4. Dan Browne says:

    I’m very sorry about the broken link – it should be fixed now! Let me know if it isn’t.

  5. Tojot says:

    I love the TabLimit, but I’d add one option to it: add the closed tab to the reading list first.
    That would make my life so much safer.

    • Dan Browne says:

      As far as I am aware, extension access to Reading List is not yet supported by Safari. I’ll add this as an optional feature when it does – I can see it would be useful.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s